OroChippw / SegmentAnything-OnnxRunner

SegmentAnything-OnnxRunner is an example using Meta AI Research's SAM onnx model in C++.The encoder and decoder of SAM are decoupled in this repository.
MIT License
97 stars 19 forks source link

How to get all objects in a picture without given the points or box information? #27

Open happybear1015 opened 1 year ago

happybear1015 commented 1 year ago

I just want get all the objects

OroChippw commented 1 year ago

This situation is not considered in this repository. If you want to segment all objects, it is recommended to use the newly launched FastSAM or MobileSAM, which will be updated into this repositorylater

cyrillkuettel commented 10 months ago

Just for completeness, if you really want to do this, you could generate a grid of point prompts over the image, which gives you evenly distributed squares. Then run inference on each square, filter out duplicates/overlaps and merge into a single image. Roughly speaking that's what's being done in the the original repo, they use 64 points.

It's not actually as slow as it sounds, because you can use batch size > 1 to process multiple images