bowang-lab / MedSAM

Segment Anything in Medical Images
https://www.nature.com/articles/s41467-024-44824-z
Apache License 2.0
2.43k stars 320 forks source link

Error in the bounding box arguments in teh command line #270

Open Biopticon opened 3 weeks ago

Biopticon commented 3 weeks ago

We are trying to run MedSAM in the command line based on the information given here. Since it is not clear how to pass bounding box arguments, we formed the command line like this:

!python '/content/MedSAM_Inference.py' -i '/content/L3.3 Parental 2-Control-1-0-38_texture.jpg' -o '/content/output' --box "250 180 400 350"

We get an error message:

" File "/content/MedSAM_Inference.py", line 127, in box_1024 = box_np / np.array([W, H, W, H]) * 1024 TypeError: ufunc 'divide' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''

How do we define the bounding box in the command line?

JunMa11 commented 1 week ago

Hi @Biopticon ,

Sorry for my late reply. We were busy with the CVPR challenge during the past month https://www.codabench.org/competitions/1847/. Finally, it was done last week.

Thanks for pointing it out. We have fixed this bug. Could you please try again?

python MedSAM_Inference.py -i assets/img_demo.png -o ./ --box "[95,255,190,350]"