Segment with multiple bounding boxes
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?
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
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?