Skip to content

MobileSAM ONNX models v1

Choose a tag to compare

@palavido-dev palavido-dev released this 21 Jul 15:09

MobileSAM exported to ONNX for the GratisGIS magic-outline digitizing tool.

Provenance: exported from the official MobileSAM checkpoint (weights/mobile_sam.pt, Apache-2.0, https://github.com/ChaoningZhang/MobileSAM) using samexporter (encoder) and MobileSAM's own scripts/export_onnx_model.py (decoder, --return-single-mask --gelu-approximate --opset 17, legacy TorchScript exporter). torch 2.10.0+cpu, onnx 1.20.1.

  • mobilesam-encoder.onnx: image encoder. Input input_image float32 (1, 3, 1024, 1024), SAM normalization (mean 123.675/116.28/103.53, std 58.395/57.12/57.375). Output image embeddings (1, 256, 64, 64). Runs server-side in the analysis worker.
  • mobilesam-decoder.onnx: prompt encoder + mask decoder, single-mask. Runs in the browser via onnxruntime-web.

SHA256SUMS.txt covers both files; the server Dockerfiles pin these hashes. MobileSAM's Apache-2.0 license text is attached.