mask-generation Β· Sam3TrackerModel (1008Β² ViT + 3-Level FPN) Β· WebGPU q4f16 (302.3 MB) / CPU WASM q4 (378.8 MB)

SAM 3 Tracker β€” Promptable Segmentation & Fast Cached Mask Decoder

Meta's Segment Anything 3 Tracker (onnx-community/sam3-tracker-ONNX, upstream facebook/sam3) splits segmentation into two dedicated ONNX sessions: a 32-layer 1008Γ—1008 vision encoder emitting a 3-level feature pyramid (288Β², 144Β², 72Β²) and a lightweight prompt encoder + mask decoder that predicts three candidate masks ([1, 1, 3, 288, 288]) with calibrated iou_scores. Encode an image once; every additional point or box prompt re-decodes from the cached pyramid in under 40 ms β€” 100% locally in a Web Worker.

At a glance

Verified Hugging Face Hub metadata and tensor shapes for onnx-community/sam3-tracker-ONNX
Browser ONNX repo onnx-community/sam3-tracker-ONNX (upstream facebook/sam3, Meta SAM License β€” public community ONNX mirror)
Task & architecture mask-generation Β· Sam3TrackerModel (model_type: sam3_tracker): 32-layer ViT backbone (1024-d, 16 heads, patch_size: 14, window 24, global attention layers 7/15/23/31, RoPE) + 3-level FPN neck (256-d) + 2-layer prompt/mask decoder
Backends & verified sizes WebGPU q4f16: 302,301,763 B (302.3 MB, requires shader-f16) Β· CPU WASM q4 (and non-f16 WebGPU): 378,752,101 B (378.8 MB) β€” both verified live with 0 NaN
Input & output shapes pixel_values [1, 3, 1008, 1008] (mean/std [0.5, 0.5, 0.5]) β†’ 3-level FPN embeddings (288Γ—288, 144Γ—144, 72Γ—72) β†’ pred_masks [1, 1, 3, 288, 288], iou_scores [1, 1, 3], object_score_logits [1, 1]
Runtime isolation Transformers.js 4.3.2 pinned strictly inside models/sam3-tracker-onnx/worker.js (off-main-thread FIFO Web Worker; shared lib/webai.js stays on 3.7.5)
Hardware capability Probing WebGPU adapter and shader-f16 support…

1. Interactive Point & Box Workbench

Pick a zero-person starter scene below, drop a local PNG/JPEG/WebP here, or paste from clipboard (Ctrl/⌘+V). Click to add +1 foreground / βˆ’1 background points, or switch to Box Prompt and drag a rectangle.

Initialise SAM 3 Tracker above to encode the scene into 3-level FPN embeddings and decode 3 candidate masks.

Backend & Dtype–
Vision Encode–
Mask Decode–
Embedding Cache–
Selected IoU–
Object Logit–
Mask Coverage–
Tensor NaN Count–

Interactive Prompt Canvas

Scene: Snow Bicycle Prompt: waiting for model

3-Mask IoU Candidate Selector (iou_scores)

See Inside Β· Split Encoder vs Prompt/Mask Decoder

Sam3TrackerModel separates heavy image encoding from lightweight prompt decoding so interactive clicks re-run only the ~5.4 MB decoder over cached 3-level FPN tensors.

Session 1 Β· vision_encoder 1008Γ—1008 ViT-L (32L) β†’ 3-level FPN
288Β² Β· 144Β² Β· 72Β² (cached per image)
Session 2 Β· prompt_encoder_mask_decoder Points + Box + FPN β†’ 3 Masks + IoU
[1, 1, 3, 288, 288] (<40 ms re-prompt)

Candidate Predicted IoU Distribution

Live ONNX session and tensor inspection readout
ONNX sessions–
FPN embedding dims–
Raw pred_masks dims–
Active prompt–
Encode / Decode split–
Image attribution–

Use-Case Ladder

Four dedicated interactive routes pushing SAM 3 Tracker from single-click cutouts to multi-frame tracking, prompt-ambiguity auditing, and zero-click RT-DETRv2 β†’ SAM 3 instance segmentation.

Show the code

Show the code β€” worker.js: segmentFrame() (cached 3-level FPN prompt decoding & NaN-checked 3-mask output)

References