CASIA-IVA-Lab / FastSAM

Fast Segment Anything
GNU Affero General Public License v3.0
7.35k stars 687 forks source link

TypeError: 'int' object is not subscriptable #71

Closed penglu666 closed 1 year ago

penglu666 commented 1 year ago

when run python Inference.py --model_path ./weights/FastSAM-x.pt --img_path ./images/dogs.jpg --box_prompt "[570,200,230,400]" in README.md this error occurs: Traceback (most recent call last): File "Inference.py", line 121, in <module> main(args) File "Inference.py", line 93, in main if args.box_prompt[0][2] != 0 and args.box_prompt[0][3] != 0: TypeError: 'int' object is not subscriptable so, the correct code should be: python Inference.py --model_path ./weights/FastSAM-x.pt --img_path ./images/dogs.jpg --box_prompt "[[570,200,230,400]]"

an-yongqi commented 1 year ago

Thank you for your contribution! You are right, we have fixed it in README.md.