Segment Anything 2
An open-source image and video segmentation model runs on your own GPU machine and tracks selected objects with masks you can refine.

Segment Anything 2 (SAM 2) is Meta's model for creating object masks in images and videos. It's for developers and researchers building visual applications or annotating footage, with interactive selection and correction.
- Object selection: Identify an object with a click, a box, or a mask in a still image or video frame.
- Video tracking: Track multiple selected objects across frames, including objects that temporarily disappear from view, and refine predictions with additional prompts on any frame.
- Interactive processing: The model supports real-time interaction and can segment unfamiliar objects and scenes without training specifically for each one.
- Custom training: Train or fine-tune SAM 2 with your own image datasets, video datasets, or a combination of both.
SAM 2 runs on your own GPU machine using Python and PyTorch. The Apache 2.0 open-source project includes inference code, downloadable pretrained models, and a web demo you can host locally. Meta also provides a hosted demo. You can load the models through Hugging Face.
The accompanying SA-V video dataset contains annotations for whole objects, object parts, and objects obscured from view.