Skip to content

Video understanding, tracking, generation, and world models · Motion and tracking · VID032 · Model

TAPIR

Tracks user-specified points through a video using per-frame initialization followed by temporal refinement. It estimates both point location and visibility-related information, making it useful for long trajectories…

Explained here Component demo, not a trained model CodeSplash's run and the reference's record

In CodeSplash

Documented in the Academy only. There's no Set up button.

Availability
Explained here
Code example
Component demo, not a trained model
Who ran it
CodeSplash's run and the reference's record
CodeSplash's run
The reference's example ran in Python and R here, and they agree.
The reference's record
Python: Ran in the reference's review. The report doesn't record which version of the code ran. R: Reviewed but not run: R wasn't available to the reference's authors.

Purpose

Tracks user-specified points through a video using per-frame initialization followed by temporal refinement. It estimates both point location and visibility-related information, making it useful for long trajectories where simple frame-to-frame flow accumulation drifts.

Question / objective

Estimate image displacement or maintain the location and identity of objects/points over time. This is a learning or inference objective, not a test of a statistical null hypothesis.

Method type and supervision

model · Motion and tracking. Mixed: supervised neural perception or non-neural inference over detections; see the individual assumptions.

Architecture / computational structure

Global per-frame point matching followed by temporal trajectory and visibility refinement.

Assumptions

Inputs must satisfy the temporal, modality and annotation protocol described below. A visible surface point can disappear, reappear or become indistinguishable. Predicted confidence must not be treated as guaranteed visibility, and query placement changes difficulty.

Formula / computational definition

qt=arg⁡max⁡ps(ft0(qt0),ft(p))q_t=\arg\max_p s(f_{t_0}(q_{t_0}),f_t(p)) illustrates initialization by query-feature matching; a learned temporal refiner updates trajectories and confidence. This expression omits the paper's full probabilistic and refinement machinery.

Parameters and notation

Learned/estimated quantities: Neural feature/refinement weights are learned when the method contains a network; coordinates, flow fields and track states are inferred outputs, not fixed network parameters. Symbols specific to the objective are defined with the equation. Hyperparameters and design choices: Query frame, spatial resolution, refinement iterations, temporal windowing and visibility thresholds affect outputs.

Fitting, fine-tuning, and adaptation

Tune on representative trajectories with visibility labels. Freeze feature encoders first if data are small; evaluate reappearance and domain shift before broad unfreezing. Use a separate adaptation validation split, monitor the target metric and retention of previously useful behavior, and save the exact preprocessing and training configuration.

How to use and calibrate

Fix the input protocol and target before fitting; choose design settings on held-out source videos, then freeze the evaluation procedure. Use point-tracking benchmarks with occlusion-aware accuracy and appropriate coordinate scaling; report trajectory errors and reappearance behavior.

Example application

Track a marked point on an object through occlusion.

Interpretation / pitfalls

Watch out

An optimized training objective or a favorable example does not establish generalization. Use point-tracking benchmarks with occlusion-aware accuracy and appropriate coordinate scaling; report trajectory errors and reappearance behavior. The example below isolates one mechanism and cannot substantiate a full-model benchmark claim.

Python and R code examples

Component: Initialize a point from feature similarity in each frame. Dependencies: NumPy in Python; base R in R; run the shared setup above. Python component: executed successfully. R component: unexecuted. No complete model training or pretrained inference was executed.

Full implementation route — Python: Use the authors' tracker with explicit query coordinates and time indexing. R: Pass queries and frames through a Python bridge, then plot trajectories and compute visibility-conditioned errors in R.

Python and R

The reference's own programs, shown as written. A component demo shows one central piece of the method; it doesn't train a full model.

Python

Component demo, not a trained model — Initialize a point from feature similarity in each frame.

Shared setup for this chapter
import numpy as np

def softmax(x):
    z = np.asarray(x, dtype=float)
    e = np.exp(z - z.max())
    return e / e.sum()
query = np.array([1.,0.])
frame_features = np.array([[[1.,0.],[0.,1.]],[[.1,.9],[.9,.1]]])
scores = frame_features@query
locations = scores.argmax(axis=1)
print("initial point positions",locations,"peak scores",scores.max(axis=1))
# Scores are similarities, not calibrated visibility probabilities.
R

Component demo, not a trained model — Initialize a point from feature similarity in each frame.

Shared setup for this chapter
softmax <- function(x) {
  e <- exp(x - max(x))
  e / sum(e)
}
query <- c(1,0)
frames <- list(rbind(c(1,0),c(0,1)),rbind(c(.1,.9),c(.9,.1)))
scores <- lapply(frames,function(f) as.vector(f%*%query))
print(sapply(scores,which.max)-1L)
print(sapply(scores,max)) # not calibrated visibility

Sources

From the CodeSplash reference, entry VID032.