Skip to content

Feature/api sam predict boxes#198

Open
Dutch77 wants to merge 2 commits intocontinue-revolution:masterfrom
Dutch77:feature/api-sam-predict-boxes
Open

Feature/api sam predict boxes#198
Dutch77 wants to merge 2 commits intocontinue-revolution:masterfrom
Dutch77:feature/api-sam-predict-boxes

Conversation

@Dutch77
Copy link
Copy Markdown

@Dutch77 Dutch77 commented Mar 18, 2024

return bounding boxes on dino and sam API

@light-and-ray
Copy link
Copy Markdown
Contributor

You breakes ui and extensions which use it

@light-and-ray
Copy link
Copy Markdown
Contributor

You can save it inside image object instead

@Dutch77
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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