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

Will this update to sam2.1? #18

Open
lu-ming-lei opened this issue Nov 27, 2024 · 2 comments
Open

Will this update to sam2.1? #18

lu-ming-lei opened this issue Nov 27, 2024 · 2 comments

Comments

@lu-ming-lei
Copy link

This job is very meaningful!
As Sam2.1 has significant optimizations compared to 2.0, will version 2.1 be provided in the future?

@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.

@12travellers
Copy link

Actually you can just add (sam2.1_tiny for example)
model_type, model_cfg = "sam2.1_hiera_tiny", "configs/sam2.1/sam2.1_hiera_t.yaml"
at the start of colab's Export Encoder part.
You can get the onnx model for 2.1, and directly use it with the code.

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

3 participants