vietanhdev / samexporter Goto Github PK
View Code? Open in Web Editor NEWExport Segment Anything Models to ONNX
Home Page: https://pypi.org/project/samexporter/
License: MIT License
Export Segment Anything Models to ONNX
Home Page: https://pypi.org/project/samexporter/
License: MIT License
There are three interesting projects:
It would be fantastic if you were willing to add support for them to the tool, so we could test/evaluate more easily.
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
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')
Running converters it returns me this error : ValueError: Unsupported ONNX opset version: 17
I had this type of error what can I do ?
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.
Why did you split sam into two different submodular named encoder and decoder? What's different between decoder and encoder? Can I use SAM as single model?
Thanks for your answers.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.