Segment Anything Fast is an open-source project from Meta’s PyTorch team, published on GitHub, that re-engineers the Segment Anything Model for batched, high-throughput offline inference. The project has gathered around 1,300 GitHub stars and was last updated in 2025.
SAM is excellent at interactive segmentation, but production pipelines often need to segment thousands of images offline, where the original implementation leaves GPU performance on the table. Segment Anything Fast restructures inference around batching and modern PyTorch acceleration โ torch.compile, SDPA attention and half-precision execution โ so image embeddings and mask decoding run at much higher throughput on the same hardware. It keeps SAM’s promptable behaviour (points, boxes and masks) while targeting batch jobs such as dataset annotation, pre-labelling for training data and large-scale image processing. The repository includes benchmark scripts comparing throughput against the reference implementation and examples for running the accelerated pipeline. For teams already invested in the PyTorch ecosystem, it is the practical way to take SAM from demo to bulk workload without changing models.
Segment Anything Fast is free and open source under the Apache 2.0 license. You only supply the GPU compute.
Computer-vision engineers running SAM at scale โ dataset builders, annotation pipelines and anyone segmenting large image collections offline.