The Fast Segment Anything Model(FastSAM) is a CNN Segment Anything Model trained using only 2% of the SA-1B dataset published by SAM authors. FastSAM achieves comparable performance with the SAM method at 50× higher run-time speed.
FastSAM vs SAM


Two model versions of the model are available with different sizes. Click the links below to download the checkpoint for the corresponding model type.
- default or FastSAM: YOLOv8x based Segment Anything Model
- FastSAM-s: YOLOv8s based Segment Anything Model
In below demo I have made used of default or FastSAM model
Demo 🔗

As seen in above image, without any custom training FastSAM is able to identify the document while ignoring the background. Hence this model can be used for cropping and removing background from images.
1.) FastSAM