Ontologies
The following table shows the Ontology shapes for which SAM 2 tracking can be used.
| Ontology Shape | SAM 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.
| Modalities | SAM 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.
-
Click the wand icon next to the class you want to label, or press Shift + A to toggle SAM mode.
-
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.
-
Specify the number of frames you want to track the instance across.
-
Click Run tracking or press Shift + T to start the SAM 2 tracking algorithm.
-
Click Save when tracking completes to save the generated labels.
Track Existing Instances
Method 1:
-
Click Automated labeling.
-
Expand the Tracking and interpolation section.
-
Select the instances you want to track.
-
Make sure the Tracking method is selected.
-
Set the tracking annotation interval. This defines how many consecutive frames an instance can be missing before the tracking algorithm stops.
-
Specify the frame range you want to track the selected instances across.
-
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.
-
Right-click the instance label you want to start tracking.
-
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:
-
Click one of the objects you want to track.
-
Hold Shift on your keyboard and select all the other objects you want to track.
-
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.