SAM 3, ONNX export for PIXL
SAM 3 by Meta. This repository holds PIXL's ONNX export of Meta's SAM 3
image model: concept prompts ("red car" finds every instance) and exemplar
boxes. It is split into three graphs, run by the PIXL engine's
segment_concept (@xuckless/pixl-engine).
This is a derivative of the SAM Materials. It is distributed under the SAM License (LICENSE), the same terms as Meta's release, and your use is bound by that agreement, trade controls included. It is not an official Meta release.
Files
| File | Inputs โ outputs | Bytes | SHA-256 |
|---|---|---|---|
sam3_image_encoder_fp16.onnx |
image [1,3,1008,1008] โ the detector's FPN and positional encodings |
908,717,454 | 709e68c56ba6c1e40c0cfa3381b06b29fc358b1281c706e02c1ff45d71dead8c |
sam3_text_encoder_fp16.onnx |
tokens int64 [1,32] โ language_features, language_padding, language_embeds |
706,988,044 | 2145c1a55137ea64076b441b48a79feaeebdcc6932154c9f702e54702a96eab9 |
sam3_decoder.onnx |
the encoders' outputs + 8 exemplar slots and their mask โ pred_logits, pred_boxes, pred_masks, presence_logit |
129,868,227 | f6749e7b7a558ab3b16b0ba75075ebe7086003d86d129f8fa831dea727f01a28 |
FP16 storage: both encoders store their weights in float16 and compute in float32. On a test photograph their masks match the float32 export exactly (IoU 1.0000, scores equal to 3 places).
The tokenizer is CLIP's BPE merges (bpe_simple_vocab_16e6.txt.gz), from
facebookresearch/sam3.
How it was made
- Source:
facebook/sam3sam3.pt(3,450,062,241 B, sha2569999e2341ceef5e136daa386eecb55cb414446a00ac2b55eb2dfd2f7c3cf8c9e), code at facebookresearch/sam32345a4ad109ac29c569da749c91d84f10dc08c40. - Export:
tests/models/export/export_sam3.pyin xuckless/pixl-engine, run with torch 2.14.0+cpu, onnx 1.23.0 and onnxruntime 1.30.0. It is byte-reproducible. - Checked against PyTorch on the same inputs:
- image encoder within 1.6e-4;
- text encoder within 1.1e-5;
- decoder within 4.5e-3 on mask logits up to 69.
- On a real photograph: "road" gives presence 0.943 and mask IoU 0.970
against Meta's own
Sam3Processor.
Attribution
SAM 3 ยฉ Meta Platforms, Inc. Licensed under the SAM License. Exported by PIXL (xuckless).
Model tree for xuckless/pixl-sam3-onnx
Base model
facebook/sam3