facebookresearch / segment-anything

The repository provides code for running inference with the SegmentAnything Model (SAM), links for downloading the trained model checkpoints, and example notebooks that show how to use the model.
Apache License 2.0
47.69k stars 5.64k forks source link

YOLO&SAM onnx exporter #748

Open yanzongs opened 6 months ago

yanzongs commented 6 months ago

Hello, when I need to combine YOLO and SAM together, I need to export onnx together with the for boxes in the prompt encoder and mask decoder. Do you have any specific instructions to tell me how to do it?

Greg7000 commented 6 months ago

I recommend you take a look at:

https://github.com/AndreyGermanov/sam_onnx_full_export/blob/main/sam_onnx_export.ipynb or https://github.com/vietanhdev/samexporter (please note that on my side to manage to get it to work I need to perform local install instead of PyPi install)

yanzongs commented 6 months ago

I recommend you take a look at:

https://github.com/AndreyGermanov/sam_onnx_full_export/blob/main/sam_onnx_export.ipynb or https://github.com/vietanhdev/samexporter (please note that on my side to manage to get it to work I need to perform local install instead of PyPi install)

However, the tutorial you provided still converts prompt encoder and mask decoder together into decoder part, could you please just generate decoder