Models · Promptable segmentation
EdgeTAM
EdgeTAM (Zhou et al., CVPR 2025): segments the object you point at or box in a single photo, like SAM 2 but with a small RepViT image encoder so it runs on phones. Image mode only here (no video tracking). Apache-2.0 code and weights.
experimental Fork of facebookresearch/EdgeTAM@7711e01 · backends: portable, kernels
- Paper EdgeTAM: On-Device Track Anything Model CVPR 2025 · first released 13 Jan 2025
Checkpoint edgetam
Paper 2025 Added in 0.4.0 Evaluated with 0.4.0
Use it
pip install fastforks Lean install with only what this model needs: pip install "fastforks-core[timm]"
from fastforks import promptable_segmentation
model = promptable_segmentation.load("edgetam") # fastest backend that runs here
result = model("photo.jpg", input_points=[[450, 600]], input_labels=[1]) # a click (x, y; label 1 = object), or input_boxes=
# result fields: masks, iou_scores, pred_masks
masks = result.masks # a torch tensor
arrays = result.numpy() # the tensor fields as NumPy arrays: arrays["masks"]
result.backend # what ran: mode, device, dtype
Other ways to run it
- Backend:
promptable_segmentation.load("edgetam", mode="kernels") # or "portable", "auto" (default) - Precision:
promptable_segmentation.load("edgetam", dtype="float32") # full precision: slower, portable only
fastforks bench edgetam Times the model on this machine. load(…, mode="portable") or mode="kernels" picks a backend; usage guide.
Speed and memory
Every backend on one GPU (RTX 5060 Ti 16 GB) and the same input, the authors’ code included. Kernels runs fp16. Portable runs fp16 on CUDA.
| Backend | dtype | Time per call (ms) | vs original fp32 | Peak memory allocated / reserved | Load (s) | First call (s) |
|---|---|---|---|---|---|---|
| Original fp32original default fp32 (set_image + one point predict, numpy RGB in) | fp32 | 22.0 | – | 430 MiB/574 MiB | 0.6 | 0.02 |
| Original fp16torch.autocast(float16) around set_image + predict (the original has no precision option) | fp16 | 24.7 | 0.89× | 351 MiB/470 MiB | 0.3 | 0.03 |
| Portable fp32 | fp32 | not measured | – | – | – | – |
| Portable | 9.33 | 2.4× | 126 MiB/158 MiB | 0.3 | 0.01 | |
| Kernels | 6.94 | 3.2× | 126 MiB/156 MiB | 0.3 | 0.01 | |
| Portable + torch.compile | 6.16 | 3.6× | 139 MiB/162 MiB | 17 (build) | – | |
| TensorRT fp16image encoder only | fp16 | 2.27 | 9.7× | 72 MiBenginenot comparable | 44 (build) | – |
Measured on RTX 5060 Ti 16 GB, torch 2.14.1+cu130, 2026-11-28. Median of 5 after 3 warm-up, uint8 CUDA input, card defaults; peak = max over the first call and the timed calls. Ratios divide two
times of this table (same GPU, same input). Original fp16 is the authors’ own precision option, else torch.autocast. torch.compile and TensorRT: build time instead of load time. TensorRT memory (engine, not comparable) is the GPU memory the engine took, read from the driver because TensorRT allocates outside PyTorch, so it can't be compared with the PyTorch peaks of the other rows.
Other devices
Not measured on other devices yet.
Licence and weights
Commercial use allowed
- Code
- Apache-2.0 LICENSE
- Weights
- Apache-2.0 source
- Training data
- distilled from SAM 2 on SA-1B and the SA-V video dataset per the paper; SA-V itself is under CC BY 4.0, SA-1B under its research licence
Our reading of the licences, not legal advice.
Weights
edgetam.pt 56.1 MB· hosted on GitHubfastforks downloads and checks these files on first use (fastforks download edgetam).
Accuracy
The test set through the authors’ code and through ours: same checkpoint, same protocol. The distance between the original’s fp32 and fp16 runs is what half precision alone costs; our runs should stay within it.
COCO val2017
every 10th image, point prompts, mIoU best of 3 / single mask %
| Run | dtype | mIoU best of 3 % ↑ | mIoU single % ↑ | images | ms / image |
|---|---|---|---|---|---|
| Original fp32 | not measured | ||||
| Original fp16 | not measured | ||||
| Portable fp32 | fp32 | 50.38 | 50.24 | 500 | 17.6 |
| Portable | fp16 | 50.37 | 50.21 | 500 | 16.4 |
| Kernels | fp16 | 50.28 | 50.22 | 500 | 14.4 |
The original code was not run on this dataset, so the table cannot show the distance to it.
One point per ground-truth instance (the interior point farthest from the border); IoU of the best-scored of 3 masks / of the single mask. Measured on RTX 5060 Ti, torch 2.14.1+cu130, fastforks c0606f892, 2026-11-30.
Closeness to the original
Beyond the test-set scores: the raw output of ours against the original’s fp32 output on the same input, pixel by pixel. CPU, float32: max |diff| <= 0.002 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 3 % and p99 <= 15 % of the reference's median |value| (absolute error of the output pred_masks).
| Check | Tolerance | Measured |
|---|---|---|
| CPU fp32, max |diff| | ≤ 0.002 (relative) | not recorded |
| GPU default dtypes, mean |diff| | ≤ 0.03 (relative) | 0.00518 (relative) |
| GPU default dtypes, p99 |diff| | ≤ 0.15 (relative) | 0.01907 (relative) |
Recorded for edgetam on RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-28, with these kernels: cudnn_haccfvm_convfvm_extrafvm_mbfvm_r3
Details
EdgeTAM (Zhou et al. 2025, Meta AI), image mode: SAM 2 with the Hiera image encoder replaced by a RepViT-M1 (a re-parameterised mobile CNN) feeding SAM 2's FPN neck, prompt encoder and mask decoder with high-resolution skip features; masks from points, boxes and mask logits, the same outputs as SAM 2.1. EdgeTAM's video predictor (the 2D spatial perceiver and the memory modules) is not ported: there is no `video`. The portable `module()` is the image encoder only.
- Input / output
- Input: one image plus a point, box or text prompt. Output: masks with quality scores.
- Input size
- any H x W >= 1, resized inside to the fixed encoder input 1024x1024 (the default export size); tested up to 1080x1920 (135 MiB allocated)
- Outputs
pred_masks,iou_scores- CUDA kernels
cudnn_haccconvolutions with fp16 accumulation (cuDNN)fvm_convfused convolutions for image classifiersfvm_extrafused transformer row operations (rotary split, SwiGLU with LayerNorm)fvm_mbfused MBConv blocks (MobileNet and EfficientNet families)fvm_r3further fused classifier blocks
Limitations
- Image mode only: EdgeTAM's video predictor (2D spatial perceiver, memory attention, memory encoder) is not ported, so `video` is not available; use the SAM 2.1 family for video.
Full reference, generated from the repository
EdgeTAM (Zhou et al., CVPR 2025): segments the object you point at or box in a single photo, like SAM 2 but with a small RepViT image encoder so it runs on phones. Image mode only here (no video tracking). Apache-2.0 code and weights.
Commercial use: yes.
| variant | input | backend | time (ms) | peak memory (MiB, allocated / reserved) |
|---|---|---|---|---|
edgetam | synthetic (1024x1024) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 22.0 24.7 9.33 6.94 6.16 2.27 (image encoder only) | 430 / 574 351 / 470 126 / 158 126 / 156 139 / 162 165 / 190 |
Details
- Original code: https://github.com/facebookresearch/EdgeTAM at
7711e012a30a - Code licence: Apache-2.0 (permissive); files:
LICENSE - Weights licence: Apache-2.0
- Licence evidence: https://github.com/facebookresearch/EdgeTAM/blob/7711e012a30a2402c4eaab637bdb00a521302c91/README.md (License section: the model checkpoints and code are under Apache 2.0); checkpoints/edgetam.pt is a file of that tree
- Training data: distilled from SAM 2 on SA-1B and the SA-V video dataset per the paper; SA-V itself is under CC BY 4.0, SA-1B under its research licence
- Kernel libraries:
cudnn_hacc,fvm_conv,fvm_extra,fvm_mb,fvm_r3 - Variants:
edgetam - Outputs: pred_masks, iou_scores
- Input size: any H x W >= 1, resized inside to the fixed encoder input 1024x1024 (the default export size)
- Tested up to (portable, fp16, RTX 5060 Ti 16 GB):
edgetam1080x1920 (0.1 GiB peak allocated, 0.2 reserved) edgetam1024x1024, first call: portable + torch.compile 17 s (cold Inductor cache), TensorRT fp16 44 s (ONNX + engine).edgetamoriginal (fp32) 1024x1024: original default fp32 (set_image + one point predict, numpy RGB in)edgetamoriginal 1024x1024: torch.autocast(float16) around set_image + predict (the original has no precision option)edgetamload / first call: original 0.26 s / 0.027 s, portable 0.32 s / 0.011† s, kernels 0.29† s / 0.007† s- † measured after the portable load or an earlier input in the same process.
- Protocol, median of 5 after 3 warm-up, uint8 CUDA input, card defaults; peak = max over the first call and the timed calls
Measured
One point per ground-truth instance (the interior point farthest from the border); IoU of the best-scored of 3 masks / of the single mask. Original = the original code named under Details, same checkpoint and protocol.
| variant | dataset | portable | portable fp32 | kernels | note |
|---|---|---|---|---|---|
edgetam | COCO val2017, every 10th image, point prompts, mIoU best of 3 / single mask % | 50.37 / 50.21 | 50.38 / 50.24 | 50.28 / 50.22 |
Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks c0606f892, 2026-11-30.
Parity
CPU, float32: max |diff| <= 0.002 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 3 % and p99 <= 15 % of the reference's median |value| (absolute error of the output pred_masks).
| variant | kernels error vs original, mean / p99 | GPU, torch | kernels used |
|---|---|---|---|
edgetam | 0.00518 / 0.01907 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400, fvm_conv@f1d064e539e1:sm_120, fvm_extra@3208ce525a91:sm_120, fvm_mb@720dd3f29bf7:sm_120, fvm_r3@f54eb890e23c:sm_120 |
Limitations
- Image mode only: EdgeTAM's video predictor (2D spatial perceiver, memory attention, memory encoder) is not ported, so
videois not available; use the SAM 2.1 family for video.
Example output
No example rendered for this checkpoint yet.