模型权重需从 HuggingFace 单独下载,代码里 checkpoint_path 要指向本地文件;安装时需指定 stage1 等 extras,否则依赖不全;README 未给出 CPU 运行说明,默认按 CUDA 环境使用。
efficientsam3
SimonZeng7108活跃维护把 SAM3 通过渐进式知识蒸馏压缩成轻量边缘模型,实现快速的可提示概念分割与跟踪,适合端侧部署。
EfficientSAM3 compresses SAM3 into lightweight, edge-friendly models via progressive knowledge distillation for fast promptable concept segmentation and tracking.
git clone https://github.com/SimonZeng7108/efficientsam3
cd efficientsam3
pip install -e ".[stage1]"README 未说明具体显存要求;安装前置要求为 Python 3.10+、PyTorch 2.0+、CUDA 11.8+(GPU 支持)。
把 SAM3 蒸馏成轻量边缘模型,实现快速可提示概念分割与跟踪
把 SAM3 通过渐进式知识蒸馏压缩成轻量边缘模型,实现快速的可提示概念分割与跟踪,适合端侧部署。
核心能力
- 用渐进式分层知识蒸馏压缩 SAM3 视觉与文本编码器
- 提供 EV-M、RV-M、TV-M 三种轻量骨干,参数量约 89M~95M
- SAM3-LiteText 仅替换文本编码器,体积缩小 27%~36%
- 支持文本提示分割,并保留完整 PCS 能力
- 支持导出 ONNX 与构建 TensorRT 引擎
容易踩的坑
- v0.4.0-efficientsam3ft-20260611EfficientSAM3 v0.4.0 — Stage 3 Fine-Tuned Models & Full PCS Release最新正式版2026-06-11 · 2026-06-11 22:10 UTC
What's New
Apologies for the Delay — Fine-Tuned Models Are Here!
We know it's been a while, but good things take time! We're happy to share that the fine-tuned EfficientSAM3 models are finally ready.
This release brings lightweight image encoders — EV-M, RV-M, and TV-M — trained end-to-end on 5% SA1B data with SACap labels for full Promptable Concept Segmentation (PCS) capabilities.
Model Vision Encoder Text Encoder Decoder Other Total Params vs ImageSAM3 EV-M EfficientViT-B1 (22.2M) MobileCLIP-S0 (42.5M) 21.0M 3.5M 89.2M 90% smaller RV-M RepViT-M1.1 (25.6M) MobileCLIP-S0 (42.5M) 21.0M 3.5M 92.7M 89% smaller TV-M TinyViT-11M (28.3M) MobileCLIP-S0 (42.5M) 21.0M 3.5M 95.3M 89% smaller Note: ImageSAM3 comparison: Vision (463M) + Text (354M) + Decoder (30.3M) + Other (14.2M) = 861.5M
Grab the checkpoints on HuggingFace.
We've also given the README a clean-up — easier to navigate, clearer model descriptions, and better organized for contributors.
Three-Stage Progressive Distillation
EfficientSAM3 delivers a complete distillation pipeline:
- Stage 1: Compact encoder distillation on SA-1B (image) + Recap-DataComp-1B (text)
- Stage 3: End-to-end fine-tuning on SAM3 data for full PCS quality
- v0.3.0-efficientsam3.1-20260413EfficientSAM3 v0.3.0 — EfficientSAM3.1 & SAM3.1-LiteText Image Model Release2026-04-13 · 2026-04-13 21:38 UTC
查看更新说明
EfficientSAM3 — v3.0 Models & Hugging Face Integration (2026-04-13)
We’re excited to announce the release of the EfficientSAM3.1 and SAM3.1-LiteText models, alongside official Hugging Face integration and advanced data engine support!
What’s new
- New Models Released: EfficientSAM3.1 and SAM3.1-LiteText image models are now available on the
stage1_sam3.1branch. - Hugging Face Integration: SAM3-LiteText has been officially merged into HuggingFace Transformers.
- Data Engine Support: Stage 3 data engine support is now live on the
data_enginebranch.
🏆 Community Heroes
A massive thank you to the community members who helped make this release possible:
- @NielsRogge, @yonigozlan, and the Hugging Face team: For integrating SAM3-LiteText into the Hugging Face API.
- @colinlin1982: For finding redundant original SAM3 weights in the efficient models and adding a trim script to reduce the model size. (Note: The new EfficientSAM3.1 models do not need to be trimmed).
- @clcl777: For adding multi-device support.
- New Models Released: EfficientSAM3.1 and SAM3.1-LiteText image models are now available on the
- v0.2.0-sam3litetext-20260218EfficientSAM3 v0.2.0 — SAM3-LiteText2026-02-18 · 2026-02-18 22:15 UTC
查看更新说明
EfficientSAM3 — SAM3-LiteText (2026-02-18)
We’re releasing SAM3-LiteText, a highly efficient text encoder variant for SAM3.
-
What’s new
- SAM3-LiteText released! Reduces text encoder parameters by up to 88% with similar performance to the original text encoder.
- Paper Released: arXiv:2602.12173 (PDF)
- Code: Available in the
sam3_litetextbranch.
-
Get the weights
- Download from Hugging Face:
Simon7108528/EfficientSAM3/tree/main/sam3_litetext
- Download from Hugging Face:
-
Quick start
- Checkout the branch:
git checkout sam3_litetext - Install:
pip install -e ".[stage1]" - Run inference with the new lite text encoders.
- Checkout the branch:
-
- v0.1.1-stage1ft-20260111EfficientSAM3 v0.1.1 — Stage 1+ Fine-Tuned (ft) Weights2026-01-11 · 2026-01-11 20:09 UTC
查看更新说明
EfficientSAM3 — Stage 1+ Fine-Tuned (ft) Weights (2026-01-11)
We’re releasing/refreshing Stage 1 geometry-prompt fine-tuned (ft) checkpoints for EfficientSAM3.
-
What’s new
- Image encoder ft weights (trained on 1% SA-1B with geometry-prompt fine-tuning)
- Text encoder ft weights (fine-tuned on SA-Co Gold + Silver text annotations)
- Updated download links in the Model Zoo (Google Drive + Hugging Face)
-
Get the weights
- See the Model Zoo in the repo
README.mdand the project page:https://simonzeng7108.github.io/efficientsam3/
- See the Model Zoo in the repo
-
Quick start
- Install:
pip install -e ".[stage1]" - Inference examples are in the repo under
sam3/efficientsam3_examples/
- Install:
-
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
EfficientSAM3: Progressive Hierarchical Knowledge Distillation from SAM1, 2 and 3
Chengxi Simon Zeng1,†, Yuxuan Jiang1, Gao Ge1, Shuai Wang2, Duolikun Danier3, Bin Zhu4, Stevan Rudinac2, David Bull1, Fan Aaron Zhang1
1Visual Information Lab, University of Bristol; 2MultiX lab, University of Amsterdam; 3University of Edinburgh; 4Singapore Management University
†Tech Lead & Corresponding Author
Table of Contents
Updates
- [2026/06/11] Stage 3 Fine-tuned Models Released! EfficientSAM3 full models (EV-M, RV-M, TV-M) fine-tuned on 5% SA1B data & SACap labels. README cleaned up. Checkpoints on HuggingFace.
- [2026/04/19] SAM3-LiteText live on HuggingFace, accepted by ICMR2026! [Docs] [Demo] Thanks @NielsRogge, @yonigozlan!
- [2026/02/18] SAM3-LiteText released! Reduces text encoder by 88% with similar performance. Paper
- [2026/01/11] Stage 1 geometry-prompt fine-tuned weights released.
- [2025/12/08] Stage 1 text encoder weights released (MobileCLIP S0, S1, MobileCLIP2 L).
- [2025/12/02] Stage 1 image encoder weights released (RepViT, TinyViT, EfficientViT).
Model Zoo
EfficientSAM3 Full Models (Lightweight Image + Text Encoders)
EfficientSAM3 compresses both SAM3's vision encoder and text encoder into lightweight student models while maintaining competitive performance on downstream benchmarks.
| Model | Vision | Text | Decoder | Other | Params | vs ImageSAM3 | Download |
|---|---|---|---|---|---|---|---|
| EV-M | 22.2M | 42.5M | 21.0M | 3.5M | 89.2M | 90% smaller | HF |
| RV-M | 25.6M | 42.5M | 21.0M | 3.5M | 92.7M | 89% smaller | HF |
| TV-M | 28.3M | 42.5M | 21.0M | 3.5M | 95.3M | 89% smaller | HF |
Note: "Text" is the distilled text encoder. "Transformer" is the mask decoder. "Other" includes segmentation head + scoring. ImageSAM3 (for comparison): Vision: 463M + Text: 354M + Transformer: 30.3M + Other: 14.2M = 861.5M
SAM3-LiteText Models (Lightweight Text Encoder Only)
SAM3-LiteText keeps the SAM3 vision encoder but replaces the text encoder with lightweight MobileCLIP variants.
| Model | Vision | Text | Decoder | Other | Params | vs ImageSAM3 | Download |
|---|---|---|---|---|---|---|---|
| LiteText-S0-16 | 463.0M | 42.5M | 30.3M | 14.2M | 550.0M | 36% smaller | HF |
| LiteText-S0-32 | 463.0M | 42.5M | 30.3M | 14.2M | 550.0M | 36% smaller | HF |
| LiteText-S1-16 | 463.0M | 63.5M | 30.3M | 14.2M | 571.0M | 34% smaller | HF |
| LiteText-S1-32 | 463.0M | 63.5M | 30.3M | 14.2M | 571.0M | 34% smaller | HF |
| LiteText-L-16 | 463.0M | 123.8M | 30.3M | 14.2M | 631.3M | 27% smaller | HF |
| LiteText-L-32 | 463.0M | 123.8M | 30.3M | 14.2M | 631.3M | 27% smaller | HF |
Note: "Text" is the distilled text encoder (42.5M-123.8M). SAM3-LiteText keeps SAM3's ViT-H vision encoder (~463M) but replaces the text encoder. "Other" includes geometry encoder + segmentation head + scoring.
Installation
git clone https://github.com/SimonZeng7108/efficientsam3
cd efficientsam3
pip install -e ".[stage1]"
Prerequisites:
- Python 3.10+
- PyTorch 2.0+
- CUDA 11.8+ (for GPU support)
Quick Start
EfficientSAM3 (Full Models with Lightweight Encoders)
EfficientSAM3 replaces both the SAM3 vision encoder and text encoder with lightweight student models (EfficientViT/RepViT/TinyViT + MobileCLIP).
from sam3.model_builder import build_efficientsam3_image_model
from sam3.model.sam3_image_processor import Sam3Processor
from PIL import Image
# Load EfficientSAM3 TV-M model (uses TinyViT vision encoder + MobileCLIP-S0 text encoder)
model = build_efficientsam3_image_model(
checkpoint_path="efficientsam3_tinyvit.pt",
backbone_type="tinyvit",
model_name="11m",
text_encoder_type="MobileCLIP-S0",
text_encoder_context_length=16,
load_from_HF=False,
)
# Process image
processor = Sam3Processor(model)
image = Image.open("your_image.jpg").convert("RGB")
state = processor.set_image(image)
# Text prompt segmentation
state = processor.set_text_prompt("dog", state)
# Get masks
masks = state["masks"]
scores = state["scores"]
print(f"Found {len(masks)} masks")
SAM3-LiteText
SAM3-LiteText keeps the SAM3 vision encoder but replaces the heavy text encoder with a lightweight MobileCLIP variant.
from sam3.model_builder import build_sam3_image_model
from sam3.model.sam3_image_processor import Sam3Processor
from PIL import Image
# Build model with LiteText encoder (keeps SAM3 ViT, replaces text encoder)
model = build_sam3_image_model(
checkpoint_path="sam3_litetext_mobileclip_s0_ctx16.pt",
text_encoder_type="MobileCLIP-S0",
text_encoder_context_length=16,
load_from_HF=False,
)
# Use as normal
processor = Sam3Processor(model)
image = Image.open("your_image.jpg").convert("RGB")
state = processor.set_image(image)
state = processor.set_text_prompt("person", state)
masks = state["masks"]
Training and Evaluation
Training:
- Stage 1: Encoder distillation training details in README_stage1.md
- Stage 3: Full fine-tuning details in README_stage3.md
Evaluation:
-
To evaluate models on COCO dataset:
python eval/eval_coco.py --coco_root data/coco --output_dir output -
To evaluate text encoder quality (token-level cosine similarity vs SAM3 teacher):
python eval/eval_text_encoder_similarity.py \ --student-ckpt /path/to/student_text_encoder_1.pth /path/to/student_text_encoder_2.pth \ --np-json data/sa-v-text/sa-co-veval/saco_veval_noun_phrases.json \ --device cuda # Optional: override teacher checkpoint python eval/eval_text_encoder_similarity.py \ --teacher-ckpt /path/to/teacher.pth \ --student-ckpt /path/to/student.pth \ --np-json data/sa-v-text/sa-co-veval/saco_veval_noun_phrases.json \ --device cuda
Datasets
For dataset setup and download scripts (data/download_*.sh) covering COCO, DAVIS, LVIS, SA-1B, SA-V, LVOS, MOSE, and YouTube-VOS, see:
To-Do List
- Release Stage 1 Image Encoder Weights: Distilled image encoder weights from SAM3 image encoder for all 9 variants (RepViT, TinyViT, EfficientViT)
- Release Stage 1 Text Encoder Weights: Distill SAM3 text encoder weights to MobileCLIP-S1 combined with all 9 image encoder variants
- Release Stage 1+ Fine-Tuned Encoder Weights: Prompt-in-the-loop supervised fine-tuning for improved encoder performance
- Release SAM3-LiteText Weights: Distilled a lightweight MobileCLIP text encoder that is competitive to the SAM3 text encoder for efficient vision-language segmentation
- Release Stage 2 Memory Bank Aligned Model Weights: Models with Perceiver-based memory compression trained on SA-V dataset
- Release Stage 3 Fine-Tuned Model Weights: End-to-end fine-tuned models on SAM3 dataset with full PCS capabilities
- ONNX/TensorRT Export: Export models to ONNX for cross-platform deployment (TensorRT engine build supported) — contributed via PR #49 by @tuan2k33. CoreML export still pending.
- Web Demo: Interactive web demonstration for real-time concept segmentation and tracking
Call for Pull Requests
The idea for this repository originated from my work on SAM2 at Amazon, particularly as part of the research described in this paper. Since company policy, I cannot share the codebase. This year I am super excited to work on making SAM3 more efficient and accessible to the community.
We welcome contributions to EfficientSAM3! Please feel free to submit pull requests to improve the codebase, add new features, or fix bugs. Particularly, we are looking for:
- Efficient MedSAM3 integration (see MedSAM2 by Bo Wang Lab)
- A Gradio demo (e.g. EfficientTAM on Hugging Face Spaces)
- A web demo deployed with Vercel (e.g. Segment Anything Web UI)
- Annotation tools, such as X-AnyLabeling and AnyLabeling
- An iOS or Android app (e.g. Cutcha Photo on the App Store)
- An NVCC-based desktop application
- Anything else that you think is cool!
All meaningful contributions will be acknowledged and integrated into both the repository and the associated paper. We warmly welcome all contributors to the repository and happily offer co-authorship to those whose work merits inclusion in the paper.
Citations
If you find EfficientSAM3 useful in your research, please cite:
@misc{zeng2025efficientsam3,
title={EfficientSAM3: Progressive Hierarchical Distillation for Video Concept Segmentation from SAM1, 2, and 3},
author={Chengxi Zeng and Yuxuan Jiang and Gao Ge and Shuai Wang and Duolikun Danier and Bin Zhu and Stevan Rudinac and David Bull and Fan Zhang},
year={2025},
eprint={2511.15833},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2511.15833},
}
@misc{zeng2026sam3litetext,
title={SAM3-LiteText: An Anatomical Study of the SAM3 Text Encoder for Efficient Vision-Language Segmentation},
author={Chengxi Zeng and Yuxuan Jiang and Gao Ge and Shuai Wang and Duolikun Danier and Bin Zhu and Stevan Rudinac and David Bull and Fan Zhang},
year={2026},
eprint={2602.12173},
archivePrefix={arXiv},
primaryClass={cs.AI},
url={https://arxiv.org/abs/2602.12173},
}
License
This repository is licensed under the Apache 2.0 License.
This project builds upon SAM, SAM2, SAM3, EdgeSAM, EdgeTAM, EfficientTAM, RepViT, TinyViT, EfficientViT, and MobileCLIP. Please refer to their respective licenses for usage terms.
Acknowledgments
We gratefully acknowledge the University of Bristol Isambard-AI supercomputer cluster for providing computational resources to this project. Special thanks to Dr. Fan Aaron Zhang for allocating resources and supporting this research.
Users
Organizations and projects using EfficientSAM3:
Note: If you're using EfficientSAM3 in your work, please acknowledge us in your publications or projects. We're happy to promote your work here! Contact us to be featured in this section.