CNN for fast image segmentation, comparable to SAM but faster
Top 6.6% on sourcepulse
FastSAM is a CNN-based model designed for efficient image segmentation, offering a significantly faster alternative to the original Segment Anything Model (SAM). It targets researchers and developers needing high-speed segmentation with comparable performance, particularly for applications requiring real-time processing or large-scale dataset analysis.
How It Works
FastSAM leverages a CNN architecture, trained on a small fraction (2%) of the SA-1B dataset, to achieve its speed advantage. This approach allows for faster inference compared to SAM's transformer-based architecture, while maintaining competitive zero-shot transfer capabilities for tasks like edge detection and object proposal generation.
Quick Start & Requirements
conda create -n FastSAM python=3.9
), activate it (conda activate FastSAM
), and install dependencies (cd FastSAM; pip install -r requirements.txt
). Install CLIP separately if using text prompts (pip install git+https://github.com/openai/CLIP.git
).python Inference.py
with options for everything, text, box, or point prompts.Highlighted Details
Maintenance & Community
The project has seen recent updates addressing edge jaggies and synchronizing with the Ultralytics project. It acknowledges contributions from various individuals and teams, including OpenXLab and Grounding-SAM. Links to demos and model zoo are provided.
Licensing & Compatibility
Licensed under the Apache 2.0 license, permitting commercial use and integration with closed-source projects.
Limitations & Caveats
While significantly faster, FastSAM's instance segmentation performance (AP) is lower than SAM and ViTDet-H on the COCO 2017 dataset. The project also notes an issue with edge jaggies, which has seen minor improvements.
1 year ago
1 day