mask-generation vision WebGPU fp16 (20.59 MB) · WASM fp16+fp32 (31.08 MB) Apache-2.0

Meta EdgeTAM

Meta's on-device Track Anything successor to SAM 2 — replacing heavy Hiera backbones with a compact RepViT vision encoder and a 2D Spatial Perceiver (up to 22× faster on edge devices). Encode any image once in a Web Worker, then click foreground/background points or drag boxes for ~145 ms cached-embedding mask decoding across 3 ambiguity scales.

At a glance

Upstream model
facebook/EdgeTAM (HF port: yonigozlan/EdgeTAM-hf)
Browser ONNX repo
onnx-community/EdgeTAM-ONNX
Task & architecture
mask-generation · EdgeTamModel (edgetam, RepViT encoder + 2D Spatial Perceiver + SAM-2-style prompt/mask decoder, 1024×1024)
Runtime & download
@huggingface/transformers@4.3.0 local worker pin · WebGPU fp16 20.59 MB · CPU WASM fp16 encoder + fp32 decoder 31.08 MB · fp32 40.90 MB
License
Apache-2.0
Honest precision note (why q8 is never used): Live Chrome probing proved that EdgeTAM's q8 / int8 export (14.21 MB) silently collapses mask logits to IoU 0.0057 (0.00% foreground mask). This demo automatically loads crisp WebGPU fp16 (20.59 MB) when a GPU adapter is present or CPU WASM fp16 encoder + fp32 decoder (31.08 MB) everywhere else.

Interactive Point & Box Promptable Mask Studio

Probing WebGPU capability…

Initialise EdgeTAM above to encode the photo and segment with clicks or boxes.

Photo: loading… Prompts: none

3-Mask Ambiguity Switcher

A single click is ambiguous (part vs object vs whole). EdgeTAM predicts all 3 scales in one forward pass — switch instantaneously with zero re-inference:

Backend –
Encode (cached) –
Decode (prompt) –
Predicted IoU –
Foreground –
Pyramid levels –

See inside EdgeTAM: two-stage cached decoding

Like SAM 2, EdgeTAM splits inference into a one-time vision encoder (model.get_image_embeddings(imageInputs)) producing multi-scale RepViT features, and a lightweight prompt encoder + mask decoder (model({ ...embeddings, input_points, input_labels, input_boxes })) that reuses those cached features for every click or box in ~145 ms on CPU WASM. Colored mask overlays and 1 px contours are baked on an OffscreenCanvas inside the worker and transferred as zero-copy ImageBitmap handles.

Active mask telemetry across all 3 ambiguity scales
Scale Predicted IoU Area (px) Coverage Status
Run a prompt to inspect the 3 predicted masks.
Show the code — embedImage() one-time RepViT vision-encoder embedding cache
Show the code — segmentPrompts() cached-embedding point/box decode & OffscreenCanvas overlay

Explore the EdgeTAM use-case ladder