greycard SAM 3
The Parts masks for greycard, a RAW development engine and editor: the iris, teeth, lips, hair, skin, a person's top and the like, each a mask a look can go on. The editor downloads these files on first use of a Parts mask; nothing here needs to be fetched by hand.
This is SAM 3 (Meta, "SAM 3: Segment Anything with Concepts", 2025),
converted to ONNX by greycard from Meta's checkpoint sam3.pt at
facebook/sam3. It is a derivative
of the SAM Materials and is distributed under the SAM License, a copy of
which is in LICENSE. greycard is not affiliated with Meta.
Files
sam3_image_encoder_fp16.onnx(908,762,234 bytes, sha256dd4733a6882264d0ab00599acd6ece3dd700f9b61b7976369b956ce41d88c23d): the image encoder, its weights and arithmetic converted to fp16.sam3_decoder.onnx(129,854,990 bytes, sha2567c205232b0698d532731fd5fa206cdea694717de69c0d8e88997a14027425564): the decoder, returning the sixteen best queries ranked, with the presence score apart.sam3_presets.bin(524,962 bytes, sha256a1c205ef7e4374a6a9072928339d957eb78f78efa01b5cf170fe0f6ff92d6917): the language encoder's output for the sixteen phrases the editor's menu asks for, computed once, so no text encoder ships.sam3_presets.jsonlists them.
What was changed
- Traced to ONNX with Meta's model code (at an ONNX-export branch that replaces the complex-valued rotary encoding with cosine and sine) as three graphs: image encoder, language encoder, decoder.
- The image encoder converted to fp16; its masks match the fp32 export's at a median IoU of 0.9996 on the trial frames.
- The decoder made to return the sixteen best queries with the presence score as its own output, instead of cutting at 0.5 inside the graph.
- The language encoder is not distributed; the phrases' encodings are.
The weights are otherwise Meta's.
Contract
- Image encoder input
image:3 × 1008 × 1008, uint8, RGB, the picture stretched to the square (bilinear). Outputsvision_pos_enc_0..2andbackbone_fpn_0..2, float32. - Decoder inputs:
vision_pos_enc_2,backbone_fpn_0..2,language_mask(bool1 × 32),language_features(float3232 × 1 × 256), and a box prompt masked off (box_coordszeros1 × 1 × 4,box_labelsones int641 × 1,box_maskstrue1 × 1). Outputsboxes(16 × 4, normalized x0 y0 x1 y1),scores(16, descending: each query's score times the presence score),presence(1),masks(16 × 1 × 288 × 288, sigmoid). - Presets: little-endian; a u32 count, then for each phrase a u16
byte length and the UTF-8 phrase, 32 mask bytes (0 or 1) and
32 × 256float32.
Reproducing the files
tools/ai/sam3_trial/ in the greycard repository (export.py,
fp16.py, table.py, with the pinned versions in
requirements-export.txt; the recipe is in its README) gives these
exact bytes from sam3.pt.
License
The SAM License, in LICENSE. By using or distributing these files you
agree to its terms, including its rules on trade controls and its
requirement to comply with applicable privacy and data protection laws.
greycard itself is GPL-3.0-or-later:
https://github.com/jessolmstead/greycard.
Model tree for jessolmstead/greycard-sam3
Base model
facebook/sam3