Run Segment Anything with ONNX models
Project description
segment-anything-onnx
Use ONNX models for Segment Anything inference.
Special thanks to Viet-Anh NGUYEN for creating the SAM Exporter libraries from which these files are derived.
Installation
From PyPi:
pip install segment-anything-onnx
From source:
git clone git@github.com:whatstyle-ai/segment-anything-onnx.git
cd segment-anything-onnx
pip install -e .
Usage
- Use the SAM Exporter to generate the ONNX models
- Copy the ONNX models to the segment-anything-onnx/models directory
- Run inference
python -m segment_anything_onnx.inference \ --encoder_model ./models/sam_vit_l_0b3195.encoder.onnx \ --decoder_model ./models/sam_vit_l_0b3195.decoder.onnx \ --image ./examples/laura.jpg \ --prompt ./examples/laura_prompt.json \ --output ./output/laura-L.png \ --show
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file segment_anything_onnx-0.0.2.tar.gz.
File metadata
- Download URL: segment_anything_onnx-0.0.2.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2fba0e9e95dbb49c8618eb20ad1260bc91355efcb5f067655ca9b828cfce02a9
|
|
| MD5 |
fa221af874afb65839de16b106f3fca8
|
|
| BLAKE2b-256 |
008c3ba7ef0b12e2925158cd00049592c838162fe5ebf5b06922fe6de06185d2
|
File details
Details for the file segment_anything_onnx-0.0.2-py3-none-any.whl.
File metadata
- Download URL: segment_anything_onnx-0.0.2-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69336a22d575d00ca2d6ba055086ae0192a472c293b456f1c1c8834dc99e14fb
|
|
| MD5 |
478aa0026971d254ecf22f7afbcdaa69
|
|
| BLAKE2b-256 |
0556ade3f4531a510ada2bbaaceb7a0241307819384236aad4aaeea216666527
|