SAM 2 brings state-of-the-art segmentation and tracking capabilities for both video and images into a single model. This unification eliminates the need for combining SAM with other video object segmentation models, streamlining the process of video segmentation into a single, efficient tool. It maintains a simple design and fast inference speed, making it accessible and efficient for users.

The model can track objects consistently across video frames in real-time, which opens up numerous possibilities for applications in video editing and mixed reality experiences. This new model builds upon the success of the original Segment Anything Model, offering improved performance and efficiency.

SAM 2 can also be used to annotate visual data for training computer vision systems. It opens up creative ways to select and interact with objects in real-time or live videos.

SAM 2 Video Tracking Key Features

  • Track objects up to 250 frames per tracking action, using SAM 2.

  • Demonstrated superior accuracy in video segmentation with three times fewer interactions compared to previous models and an 8x speedup for video annotations. For image segmentation, it is not only more accurate but also six times faster than its predecessor, SAM.

  • Object Selection and Adjustment: SAM 2 extends the prompt-based object segmentation abilities of SAM to also work for object tracks across video frames.

  • Robust Segmentation of Unfamiliar Videos: The model is capable of zero-shot generalization. This means it can segment objects, images, and videos from domains not seen during training, making it versatile for real-world applications.

  • Real-Time Interactivity: SAM 2 utilizes a streaming memory architecture that processes video frames one at a time, allowing for real-time, interactive applications.


Ontologies

The following table shows the Ontology shapes for which SAM 2 tracking can be used.

Ontology shapeSAM 2 Video Tracking
Bounding box
Rotatable bounding box
Polygon
Polyline
Primitive
Keypoint
Bitmask

Modalities

The following table shows the modalities that support SAM 2 tracking.

Ontology shapeSAM 2 Video Tracking
Images
Videos
Image Groups
Image Sequences
DICOM

Using SAM 2 Tracking

SAM 2 tracking is computationally intensive and performance might be slower than other labeling actions.

Track While Creating Labels

Before you begin, set your tracking range in the Editor Settings. By default, object tracking is configured to run for 30 frames, meaning SAM 2 tracking tracks the object across 30 consecutive frames.

  1. Click the wand icon next to the class you want to label, or press Shift + A to toggle SAM mode.

  2. Click on the instance you want to label. If needed, adjust your click until the correct region is selected by SAM.

Learn how to create labels with SAM 2 here.
  1. Specify the number of frames you want to track the instance across.

  2. Click Run tracking or press Shift + T to start the SAM 2 tracking algorithm.

  3. Click Save when tracking completes to save the generated labels.

Track Existing Instances

Method 1:

  1. Click Automated labeling.

  2. Expand the Tracking and interpolation section.

  3. Select the instances you want to track.

  4. Make sure the Tracking method is selected.

  5. Set the tracking annotation interval. This defines how many consecutive frames an instance can be missing before the tracking algorithm stops.

  6. Specify the frame range you want to track the selected instances across.

  7. Click Run tracking to begin the process.

Method 2:

Before you begin, set your default tracking range in the Editor Settings. By default, object tracking is configured to run for 30 frames, meaning SAM 2 tracking tracks the object across 30 consecutive frames.

  1. Right-click the instance label you want to start tracking.

  2. Click Track object to run SAM 2 tracking or use the keyboard shortcut Shift + T to run SAM 2 tracking for 30 consecutive frames.


Tracking Multiple Objects

To track multiple objects of any shape:

  1. Click one of the objects you want to track.

  2. Hold Shift on your keyboard and select all the other objects you want to track.

  3. Right-click on one of the selected objects and click Track X objects, where X is the number of objects selected.


Settings

The Object tracking section of the editor settings allows you to adjust the following.

Change Tracking Range

The range SAM 2 object tracking tracking runs can be adjusted in the Object tracking section of the editor settings. The default tracking range is set to 30 frames. This range includes the frame that SAM 2 tracking starts on.

Advanced Tracking

This toggle lets you choose between a faster, simpler tracking algorithm or a slower, more advanced one with higher accuracy. The advanced algorithm is enabled by default.