segment-anything
segment-anything copied to clipboard
How to obtain the ONNX model of an encoder
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 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
https://github.com/facebookresearch/segment-anything/pull/29
Check out this package for model conversion and inference code with ONNX: https://github.com/vietanhdev/samexporter.