segment-anything icon indicating copy to clipboard operation
segment-anything copied to clipboard

How to obtain the ONNX model of an encoder

Open Gretanheee opened this issue 2 years ago • 2 comments
trafficstars

I want to get the onnx from encoder,the notebooks only provides the onnx conversion method for the decoder.I would greatly appreciate it if I could receive help

Gretanheee avatar Apr 27 '23 08:04 Gretanheee

@Gretanheee you can inherit SamPredictor from nn.Module and move "get embeddings functions" into forward function , but I'm not sure what everything will work correctly

tempdeltavalue avatar May 04 '23 12:05 tempdeltavalue

https://github.com/facebookresearch/segment-anything/pull/29

matt-bernstein avatar May 05 '23 11:05 matt-bernstein

Check out this package for model conversion and inference code with ONNX: https://github.com/vietanhdev/samexporter.

vietanhdev avatar May 11 '23 12:05 vietanhdev