Export and depoly SAM(segment-anything model) on onnxruntime.
SAM repo: https://github.com/facebookresearch/segment-anything
- Install SAM via readme in SAM.
- Download SAM checkpoint & Set the path of checkpoint.
- Run python script in dir export_onnx, the sam is composed of two parts: image encoder and mask decoder, we will export them into onnx model separately
To export mask decoder, run
python export/export_mask_decoder.py --checkpoint <path/to/checkpoint> --model-type <model_type> --output <path/to/output>
Run ort_inference.py