efficientvit icon indicating copy to clipboard operation
efficientvit copied to clipboard

Segment with multiple bounding boxes

Open pvtoan opened this issue 1 year ago • 2 comments

Hi,

Thank you so much for your contributions!

Actually, I am able to use your code to do segmentation with a single bounding box by the command in "demo_sam_model.py"

parser.add_argument("--box", type=str, default="[150,70,640,400]",

However, I cannot apply multiple bounding boxes by just adding 2D matrix, for example, parser.add_argument("--box", type=str, default="[[150,70,640,400], [150,70,640,400]]",

Could you please let me know how to solve this problem?

pvtoan avatar Feb 26 '24 07:02 pvtoan

Hi pvtoan,

We use predict function of the predictor in the demo file which supports single bounding box input. You can instead use predict_torch function which supports multiple bounding boxes input, with only a few lines of code change. You can reference the example code of SAM. Our exported ONNX and TensorRT models support multiple bounding boxes input, you are welcome to use them. https://github.com/mit-han-lab/efficientvit/blob/65eb7218d62dc1f91b0b60b5e8d0cd42ef2b416a/demo_sam_model.py#L193-L198

Best, Zhuoyang

zhuoyang20 avatar Feb 27 '24 11:02 zhuoyang20

Hi,

Thank you so much for your contributions!

Actually, I am able to use your code to do segmentation with a single bounding box by the command in "demo_sam_model.py"

parser.add_argument("--box", type=str, default="[150,70,640,400]",

However, I cannot apply multiple bounding boxes by just adding 2D matrix, for example, parser.add_argument("--box", type=str, default="[[150,70,640,400], [150,70,640,400]]",

Could you please let me know how to solve this problem?

How can I get a better result given the coordinates of the box?I found that the output result box and my input box are not in the same position on the original image. Is there any compatibility process that needs to be done?

chenminupup avatar Jun 13 '24 13:06 chenminupup