> For the complete documentation index, see [llms.txt](https://docs.imerit.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.imerit.net/core-concepts/frame-interpolation.md).

# Frame Interpolation

When annotating videos, Hub can use keyframes to carry annotation information across multiple frames. This lets annotators label only the frames where something changes, instead of manually editing the same label on every frame.

Frame interpolation is available for all video file types.

## Keyframes

Whenever you create or edit an object or frame-specific classification on a video frame, you are creating a keyframe for that label.

For example, if I create a new bounding box on frame 1, I will have created a keyframe for it on frame 1. Keyframes are marked with white diamonds on the video timeline:

<figure><img src="https://3895963154-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTcOUG6rfWxqGM0N4db2P%2Fuploads%2FOlOnz4LlJSqZ6cHPsdyA%2Fimage.png?alt=media&amp;token=a52dd577-e646-4e69-8a1f-b4e2c061e5ed" alt=""><figcaption></figcaption></figure>

If I navigated to frame 20 and edited the position of the bounding box, I will have created a new keyframe for it:

<figure><img src="https://3895963154-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTcOUG6rfWxqGM0N4db2P%2Fuploads%2FuICsW3VPwhCugUxGDQv4%2Fimage.png?alt=media&amp;token=624e38ab-0b45-4708-a360-20c0597c1b47" alt=""><figcaption></figcaption></figure>

The position of the bounding box will be interpolated between frames 1 and 20. You can add, remove, and edit keyframes using the video labeling editor interface.

## Object Interpolation

For object tools, interpolation means that Hub calculates the object's shape or position on frames between keyframes.

For example:

1. You draw a bounding box around a car on frame 1.
2. You move to frame 20 and move the same bounding box to the car's new position.
3. Hub calculates the bounding box positions for frames 2 through 19.

{% hint style="info" %}
Interpolation is currently only available for the Bounding Box, Polygon, Segmentation, and Point labeling tools.
{% endhint %}

<div data-full-width="true"><figure><img src="https://3895963154-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTcOUG6rfWxqGM0N4db2P%2Fuploads%2FBrcNfLxBQLxghnFDClz6%2Fimage.png?alt=media&amp;token=d64e8f97-088a-4b08-b24a-023f97ac1623" alt=""><figcaption></figcaption></figure></div>

## Frame-Specific Classifications

Classifications can also be frame-specific. In the project ontology, enable the *Frame-specific* setting on a classification when answers should apply to individual video frames instead of the whole asset.

Frame-specific classifications do not interpolate geometry. Instead, the answer from the latest previous keyframe applies until another keyframe changes the answer, or until the classification's segment ends.

For example, if a frame-specific radio classification is set to *Green* on frame 5, *Red* on frame 15, and *Blue* on frame 40:

* frames 5 through 14 use *Green*
* frames 15 through 39 use *Red*
* frame 40 and later frames in the classification segment use *Blue*

You can mark frames within the classification's segment as [out of view](/labeling/labeling-editor-interface/video-labeling-editor.md#out-of-view). On those frames, the editor shows the existing answer as read-only. Exports with **Only Key Frames** disabled omit answers on those frames; exports with **Only Key Frames** enabled retain the stored keyframes.

## Import Format Counterparts

When importing video annotations, the UI concepts above map to these Ango Import Format fields:

<table data-full-width="true"><thead><tr><th>UI concept</th><th>Import field</th><th>What it controls</th></tr></thead><tbody><tr><td>Timeline row for one tracked object or frame-specific classification</td><td><code>objectId</code></td><td>Groups keyframes that belong to the same object or classification instance.</td></tr><tr><td>Start and end of the timeline row</td><td><code>segments</code></td><td>The frame range where the object or frame-specific classification exists.</td></tr><tr><td>Frames where the object or answer changes</td><td><code>keyFrames</code></td><td>Frame-number keys containing the object geometry or classification answer for that frame.</td></tr><tr><td>Out-of-view spans</td><td><code>outOfViewSegments</code></td><td>Frame ranges where the object is hidden or the frame-specific classification is read-only. Full-frame exports omit these frames.</td></tr><tr><td>A single page in multi-image or DICOM assets</td><td><code>page</code></td><td>The page or frame where a non-interpolated annotation belongs.</td></tr></tbody></table>

Video keyframe numbers are frame indexes. They start from 0.

{% hint style="info" %}
For complete JSON examples, see the video object and video classification sections in the [Ango Import Format](/data/importing-and-exporting-annotations/importing-annotations/ango-import-format.md#video-and-multi-image-labeling) page.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.imerit.net/core-concepts/frame-interpolation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
