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

A utility to export both SAM encoder and predictor to ONNX

Open ltetrel opened this issue 10 months ago • 2 comments

Hi,

At Kitware Europe, we are currently working on integrating SAM in paraview/vtk as a new cpp plugin for smart and fast selection of point/cell data in a render view. To optimize the computing time, one can definitively cache the image embeddings if the image does not change, hence greatly reducing the annotation time if multiple clicks (only the mask encoding/decoding is called). To achieve this, we developed internally a utility to export both the SAM encoder (image encoder) and predictor (prompt encoder/decoder + joint decoder) to ONNX. We thought it could be usefull to the community as well: https://gitlab.kitware.com/keu-computervision/ml/sam-onnx-exporter

Thanks to @iel-amra who worked on this,

ltetrel avatar Feb 04 '25 09:02 ltetrel

Hi,does this repo "https://gitlab.kitware.com/keu-computervision/ml/sam-onnx-exporter" support sam2.1, or just sam1.0?

wenhui-ml avatar Mar 21 '25 13:03 wenhui-ml

Hi @wenhui-ml ,

It only support SAM1 at the moment, but I imagine that the API should be somehow similar in SAM2,

ltetrel avatar Mar 24 '25 13:03 ltetrel