Skip to content

Conversation

@Dutch77
Copy link

@Dutch77 Dutch77 commented Mar 18, 2024

return bounding boxes on dino and sam API

@light-and-ray
Copy link
Contributor

You breakes ui and extensions which use it

@light-and-ray
Copy link
Contributor

You can save it inside image object instead

@Dutch77
Copy link
Author

Dutch77 commented Mar 18, 2024

It's appended stuff. Which UI and extension does it break please?

It's really shame it doesn't return this info. Can you suggest any other way than meta data of image? I need to automate some stuff and extracting info from image seems really non-standard way of how to do stuff. (actualy cannot do this without some heavy implementation in lib I use)

@light-and-ray
Copy link
Contributor

light-and-ray commented Mar 19, 2024

You can use your fork in your app, I don't think it's a big problem

Can you suggest any other way than meta data of image?

I mean here:

return Image.fromarray(show_boxes(image_np, boxes_filt_numpy.astype(int), show_index=True)), ..., boxes_filt

turn it into

res = Image.fromarray(show_boxes(image_np, boxes_filt_numpy.astype(int), show_index=True))
res.boxes_filt = boxes_filt
return res, ...

In apy.py get them by

[x.boxes_filt for x in sam_output_mask_gallery[:3]]

and

dino_output_img.boxes_filt

@light-and-ray
Copy link
Contributor

light-and-ray commented Mar 19, 2024

sam_predict and dino_predict are used in extension's UI, and in my extension https://github.com/light-and-ray/sd-webui-replacer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants