(Image from https://github.com/facebookresearch/segment-anything/blob/main/notebooks/images/truck.jpg)
Automatically downloads the onnx and prototxt files on the first run. It is necessary to be connected to the Internet while downloading.
For the sample image,
$ python3 edge_sam.pyIf you want to specify the input image, put the image path after the --input option.
You can use --savepath option to change the name of the output file to save.
$ python3 edge_sam.py --input IMAGE_PATH --savepath SAVE_IMAGE_PATHIf you want to specify the positive point, put the coordinates(x,y) after the --pos option.
$ python3 edge_sam.py --pos 500 375And if you want to specify the negative point, put the coordinates after the --neg option.
$ python3 edge_sam.py --pos 500 375 --neg 360 405If you want to specify the box, put the coordinates(x1,y1,x2,y2) after the --box option.
$ python3 edge_sam.py --box 425 600 700 875These options can be combined.
$ python3 edge_sam.py --pos 500 375 --pos 1125 625$ python3 edge_sam.py --box 425 600 700 875 --neg 575 750PyTorch
ONNX opset = 11

