GithubHelp home page GithubHelp logo

vietanhdev / samexporter Goto Github PK

View Code? Open in Web Editor NEW
178.0 6.0 20.0 6.23 MB

Export Segment Anything Models to ONNX

Home Page: https://pypi.org/project/samexporter/

License: MIT License

Python 95.15% Shell 4.85%
segment-anything segment-anything-model onnx

samexporter's Issues

Where does the 684 height size comes from?

Not an issue. The code works perfectly for me. I saw the original code expects 1024x1024 image size. So, I was just wondering where the 684 fixed size for height comes from. Thank you

No module named 'samexporter'

python.exe: Error while finding module specification for 'samexporter.export_encoder' (ModuleNotFoundError: No module named 'samexporter')
python.exe: Error while finding module specification for 'samexporter.export_decoder' (ModuleNotFoundError: No module named 'samexporter')

How to export decoder for mobile net model?

I've exported a mobile net model using the export_encoder script using mobilenet weights for mobilenet model. Now how do I export decoder for this?
I cannot see a mobile type in export_decoder script, also should I pass the same mobile_sam.pt or vit_h.pth model as the check point for decoder?
Any help is appreciated.

Encoder only exports for vit_h

Great job on this, exactly what I was looking for!

However, when I attempt to export the encoder using:

python -m samexporter.export_encoder --checkpoint original_models/sam_vit_l_0b3195.pth --output output_models/sam_vit_l_0b3195.encoder/model.onnx --model-type vit_l --quantize-out output_models/sam_vit_l_0b3195.encoder.quant.onnx --use-preprocess

python -m samexporter.export_encoder --checkpoint original_models/sam_vit_b_01ec64.pth --output output_models/sam_vit_b_01ec64.encoder/model.onnx --model-type vit_b --quantize-out output_models/sam_vit_b_01ec64.encoder.quant.onnx --use-preprocess

Error Output:
Loading model...
Exporting onnx model to output_models/sam_vit_l_0b3195.encoder/model.onnx...
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\ProgramData\Anaconda3\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Work\AR\samexporter\samexporter\export_encoder.py", line 178, in
run_export(
File "C:\Work\AR\samexporter\samexporter\export_encoder.py", line 157, in run_export
with open(output, "wb") as f:
FileNotFoundError: [Errno 2] No such file or directory: 'output_models/sam_vit_l_0b3195.encoder/model.onnx'

I see the flag on export_encoder.py, but I'm not sure how this should look for vit_l and vit_b?

Thanks,
Steven.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.