Closed sctrueew closed 4 days ago
Thanks for writing the issue.
Yes, we are supporting the SAM 2.1 models.
Install Segment Anything Model 2 and download checkpoints.
Copy yaml files in sam2/configs/sam2.1 to sam2.
Put export_onnx.py and david-tomaseti-Vw2HZQ1FGjU-unsplash.jpg to the root folder.
To export an ONNX model.
python export_onnx.py --mode export
To check how the ONNX model works.
python export_onnx.py --mode import
You can download exported SAM 2.1 ONNX models.
Those models are exported from SAM 2.1 checkpoints. You can export SAM 2.1 ONNX models by yourself using export_onnx.py.
model_idx = 0
model_type = ["tiny","small","base_plus","large"][model_idx]
config_type = ["t","s","b+","l"][model_idx]
version_idx = 1
version_type = ["2","2.1"][version_idx]
onnx_output_path = "checkpoints/{}/".format(model_type)
model_config_file = "sam{}_hiera_{}.yaml".format(version_type, config_type)
model_checkpoints_file = "checkpoints/sam{}_hiera_{}.pt".format(version_type, model_type)
That sounds great. I will take a look at it.
To be clear that we are supporting SAM 2.1, we updated our document.
Thank you for informing me.
Hi, thanks for your work. Is it possible to support SAM2.1?