FastSAM: 50x Faster Segment Anything Model
April 09, 2026
Category:
Practical Open Source Projects
FastSAM: The 50x Faster Segment Anything Revolution
Lightning-Fast Performance with SAM-Quality Results
FastSAM from CASIA-LMC-Lab redefines image segmentation. Trained on just 2% of the SA-1B dataset, this CNN-based model matches Meta's Segment Anything (SAM) performance while running 50x faster.
Key Stats: - 68M parameters (vs SAM-H's 0.6G) - 40ms inference regardless of prompt count - 2608MB GPU memory (vs SAM-H's 7060MB)
π 4 Powerful Prompt Modes
# Everything mode - segments everything
python Inference.py --model_path ./weights/FastSAM.pt --img_path ./images/dogs.jpg
# Text prompt
python Inference.py --img_path ./images/dogs.jpg --text_prompt "the yellow dog"
# Box prompt [x,y,w,h]
python Inference.py --box_prompt "[[570,200,230,400]]"
# Points prompt
python Inference.py --point_prompt "[[520,360],[620,300]]" --point_label "[1,0]"
π οΈ Quick Start (5 Minutes)
git clone https://github.com/CASIA-LMC-Lab/FastSAM.git
cd FastSAM
conda create -n FastSAM python=3.9
conda activate FastSAM
pip install -r requirements.txt
# Download FastSAM.pt checkpoint
python Inference.py --model_path ./weights/FastSAM.pt --img_path ./images/dogs.jpg
π Live Demos Available
- HuggingFace Space - Everything + Points mode
- Replicate Demo - All modes supported
- Gradio UI - Local web interface
- Colab Notebook - Zero setup testing
π Benchmark Results
| Method | Params | 1pt | 10pts | 100pts | E(64x64) |
|---|---|---|---|---|---|
| SAM-H | 0.6G | 446 | 464 | 627 | 6972 |
| SAM-B | 136M | 110 | 125 | 230 | 5417 |
| FastSAM | 68M | 40 | 40 | 40 | 40 |
π¬ Real-World Applications
- Edge Detection - BSDS500: ODS 0.750 (vs SAM 0.768)
- Object Proposals - COCO AR@1000: 63.7 (vs SAM-H 67.7)
- Instance Segmentation - COCO AP: 0.379
- Downstream Tasks: Anomaly Detection, Salient Object Detection, Building Extraction
π― Why Choose FastSAM?
β
Production Ready - YOLOv8 Model Hub integration
β
Developer Friendly - Python API + web demos
β
Hardware Efficient - Runs on consumer GPUs
β
Extensible - Training code released
β
Community Driven - 8.3k stars, 26 contributors
Recent Updates (June 2024)
- Edge quality improvements merged to Ultralytics YOLOv8
- HuggingFace demo updated
- TensorRT optimization available
- Semantic FastSAM extension
FastSAM proves you don't need massive ViT models for state-of-the-art segmentation. Perfect for real-time applications where speed matters most.
Original Article:
View Original