Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there any code for model export? #508

Open
XYZ-916 opened this issue Dec 26, 2024 · 1 comment
Open

Is there any code for model export? #508

XYZ-916 opened this issue Dec 26, 2024 · 1 comment

Comments

@XYZ-916
Copy link

XYZ-916 commented Dec 26, 2024

Such as onnx or torchscript

@ryouchinsa
Copy link

You can export SAM 2.1 ONNX models for image prediction using export_onnx.py in sam-cpp-macos repository.

Install Segment Anything Model 2 and download checkpoints.

checkpoints

Copy yaml files in sam2/configs/sam2.1 to sam2.

configs

Put export_onnx.py and david-tomaseti-Vw2HZQ1FGjU-unsplash.jpg to the root folder.

export

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants