micro-sam ViT-T (light microscopy) β ONNX (browser/WebGPU)
Promptable micro-sam
vit_t_lm (TinyViT encoder, via MobileSAM)
exported to ONNX for client-side inference with onnxruntime-web + WebGPU,
used by the JAX Image Tools viewer (jit-ui#90) SAM segment tool. This is the
tiny sibling of microsam-vit-b-lm-onnx β ~12x smaller encoder, ideal for
fast in-browser segmentation.
Two graphs (SAM v1 I/O):
| file | in β out | run |
|---|---|---|
encoder.fp16.onnx (fp16, ~14 MB) |
image (1,3,1024,1024) fp32 β embedding (1,256,64,64) fp32 |
once per image |
decoder.onnx (fp32, ~16 MB) |
embedding + box/point prompts β mask (resized to orig size) | per prompt |
- Image preprocessing (resize long side β 1024, SAM normalize, pad) is done on the client; the encoder is pure tensor I/O. fp16 keeps fp32 I/O.
- fp16 produced with
onnxruntime.transformers.float16. - Box prompt = two points labelled
2/3; positive/negative points1/0.
Export tooling: the sam-js project (export/export_sam_onnx.py --microsam vit_t_lm).
Base model: micro-sam vit_t_lm (TinyViT / MobileSAM, Apache-2.0); underlying
architecture Segment Anything (Apache-2.0). See micro-sam for model license.