Skip to content

Use keyframe interpolation and extrapolation ​

Keyframe interpolation and extrapolation reduce the number of frames you need to label manually. Define an object's state at keyframes, and Segments.ai calculates labels for other frames:

  • Interpolation fills in an object's position, rotation, and dimensions between keyframes.
  • Extrapolation predicts a 3D cuboid's position after its last keyframe, continuing the motion defined by its last two keyframes. Rotation, dimensions, and attributes stay constant.

Keyframe interpolation is available for 2D bounding box labels and 3D cuboid labels. Keyframe extrapolation is available for 3D cuboid labels only.

Understanding keyframes ​

A keyframe marks a frame where you've explicitly defined an object's state (position, size, rotation, etc.). Between keyframes, the system automatically interpolates the object's properties.

A delete keyframe (also called a remove-keyframe) marks a frame where you've explicitly removed an object. It indicates the object is absent from that point until the next regular keyframe.

Keyframes are managed through the timeline interface at the bottom of the editor. See Track timeline for details on the timeline interface.

Interpolating between keyframes ​

Interpolation automatically calculates an object's position, rotation, and dimensions between the states you define at keyframes. For example, label a moving car at two frames, and Segments.ai fills in the frames between them. Add more keyframes where the object's motion changes to improve the result.

You can enable or disable interpolation in the dataset's Settings → Labeling using Enable keyframe interpolation. When Use timestamps for interpolation and extrapolation is enabled, interpolation uses frame timestamps instead of frame indices.

Object-level attribute edits create new keyframes, with values copying between them. To modify attributes on objects with existing keyframes, you must update the value across all necessary keyframes.

Extrapolating after the last keyframe ​

For 3D cuboid labels, keyframe extrapolation predicts an object's position after its last keyframe. It continues the motion defined by the last two keyframes at a constant speed and direction. This can help you label moving objects as you advance through a sequence.

Extrapolation is disabled by default. To enable it:

  1. Open the dataset's Settings → Labeling.
  2. Select Enable keyframe extrapolation.
  3. Confirm the change and save the settings.

A track needs at least two keyframes with a defined position. With only one keyframe, its position stays constant. Extrapolation changes only the cuboid's center position; rotation, dimensions, and attributes retain their last values.

Review the predicted positions and adjust the cuboid when needed to create another keyframe. Add a delete keyframe where the object disappears to stop extrapolation from that frame onward.

When Use timestamps for interpolation and extrapolation is enabled, motion is calculated using frame timestamps. Otherwise, it uses frame indices.

Enabling or disabling extrapolation can affect existing labels after their last keyframe. Review affected sequences after changing this setting. When disabled, cuboids stay at their last keyframe position.

Working with keyframes ​

View the keyframes of an object ​

The timeline is always visible at the bottom of the editor and displays tracks across frames.

Timeline views ​

The timeline content changes based on your selection and the active view:

No track selected:

  • Use the View dropdown in the timeline header to switch between:
    • Tracks view: Displays all tracks with their visibility across frames
    • Scene attributes view: Displays scene-level attributes

Track selected:

  • The timeline automatically shows the selected track with its track attributes below

Keyframe indicators ​

Select a track in the viewer to see its keyframes in the timeline:

  • White diamond icons (◆): Mark frames with keyframes
  • White cross icons (×): Mark delete keyframes
  • Colored bar: Shows where the track is visible

When you select a track in the viewer, the timeline automatically switches to show only that track with its attributes. The View dropdown is disabled while a track is selected.

Add a keyframe ​

Keyframes are created automatically when you modify an object:

  1. Select a track in the viewer
  2. Navigate to a frame using the timeline navigation buttons or arrow keys
  3. Modify the object (move, resize, rotate, change shape)
  4. A keyframe is automatically created at that frame

You don't need to manually create keyframes — they're added whenever you make changes to an object.

Move a keyframe ​

Drag keyframes to different frames in the timeline:

  1. Select a track in the viewer (timeline switches to show that track)
  2. In the timeline, click and hold on a keyframe diamond (◆)
  3. Drag it to the desired frame
  4. Release to confirm — interpolation is automatically recalculated

Keyframes can only be moved within the track's visibility range (where the colored bar appears).

Remove a keyframe ​

Delete a keyframe to simplify your annotation:

  1. Select a track in the viewer
  2. Navigate to a frame with a keyframe
  3. Press Backspace

The keyframe is removed and interpolation is recalculated based on the remaining keyframes.

A track must have at least one keyframe. When there exists only one keyframe, this keyframe cannot be removed.

Working with delete keyframes ​

View the delete keyframes of an object ​

Delete keyframes appear as white cross icons (×) on blank spaces in the timeline. They indicate frames where you've explicitly removed the object.

Add a delete keyframe ​

Create a delete keyframe to mark where an object disappears:

  1. Select a track in the viewer
  2. Navigate to the frame where the object should disappear
  3. Press Backspace

The object is removed from that frame onward until the next keyframe.

Move a delete keyframe ​

Drag delete keyframes just like regular keyframes:

  1. Select a track in the viewer
  2. In the timeline, click and hold on a delete keyframe cross (×)
  3. Drag it to the desired frame
  4. Release to confirm

Remove a delete keyframe ​

Remove a delete keyframe to restore object visibility:

  1. Select a track in the viewer
  2. Navigate to a frame with a delete keyframe
  3. Press Backspace

The object becomes visible again from that frame onward.

Label occluded objects ​

Two approaches exist for objects that disappear and reappear:

  1. Adjust on reappearance: Adjust the object on its reappearance frame (creating a keyframe), then remove it where occlusion begins.
  2. Remove and merge: Remove the object where occlusion starts, label a new object where it reappears, then merge them by matching their track IDs. See Use track IDs - Merge tracks for details.

For more information on managing tracks and navigating the timeline, see Track timeline.