Skip to content

Following points through a video: TAPIR and CoTracker

Chaining frame-to-frame flow drifts. Point trackers follow chosen points through a whole video and say when each is hidden: TAPIR matches each frame and then refines the path, CoTracker tracks many points together.

Advanced ~12 min8 steps

What runs in CodeSplash

You will be able to

  • Say why chaining optical flow drifts over long videos
  • Describe TAPIR's per-frame matching followed by temporal refinement
  • Explain how CoTracker lets related points share evidence, and how that can spread a mistake
  • Score point tracks with occlusion in mind, not as calibrated visibility

Read first

01

Why not chain the flow?

Read

To follow a point for a hundred frames, you could add up a hundred frame-to-frame flow vectors. Every vector carries a small error, and the errors add up: the path drifts. Worse, when the point is hidden behind something, flow has nothing to follow and latches onto whatever is in front.

Point trackingPoint trackingFollow chosen points through a whole video, with a position and a visible-or-hidden call in every frame. sets the task differently: given a point in one frame, report its position in every frame of the video, plus whether it is visible there.

02

TAPIR: match, then refine

Read
Reference · VID032 · Explained hereTAPIRTracks 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…

TAPIR first looks for the query point's features in every frame independently, so a point that reappears can be found again without passing through the frames where it was hidden:

qt=arg⁡max⁡p s(ft0(qt0), ft(p)).q_t = \arg\max_p\, s\big(f_{t_0}(q_{t_0}),\, f_t(p)\big).

A learned refiner then smooths the whole path and estimates visibility. In the reference's toy, the query matches position 0 in one frame and 1 in the next, with peak similarities 1.0 and 0.9. Those are similarities, not probabilities that the point is visible.

03

During an occlusion

Predict

Predict first

A tracked point disappears behind a passing truck for thirty frames, then comes back. What should a good point tracker report during those frames, and how should it be scored?

Its last seen positionA position plus a 'hidden' call, and scoring that counts the callNothing: drop those frames from scoring
Reveal

A best-guess position and a "hidden" call, and scoring should count both. Point-tracking benchmarks score position accuracy on visible frames and the visible-or-hidden calls on all of them. Dropping occluded frames from scoring rewards trackers that never admit a point is gone.

04

CoTracker: points help each other

Read
Reference · VID033 · Explained hereCoTrackerTracks many points jointly so the motion of related points can help resolve ambiguity. Attention between trajectories captures shared motion and context, useful for dense or semi-dense tracking in scenes with occlusion.

Points on one object move together. CoTracker tracks many points jointly: attention between their trajectories lets a point that is hard to see borrow motion from neighbors that are easy to see, and the joint estimate is refined over several passes.

In the reference's toy, two points with similar features end up with the same motion summary, 0.999 and 0.047, while an unrelated third point keeps its own, −0.159. The same sharing can spread one wrong correspondence to all its neighbors.

05

Reading point-tracking results

Read
  • Online or offline. A tracker that sees the whole video can use later frames to fix earlier ones; an onlineOnline inferenceProcessing observations as they arrive, without seeing the future. It doesn't have to update the model's weights. tracker can't. Report which.
  • Query density. Tracking one point and tracking a dense grid are different difficulties and costs.
  • Scale. Positions in pixels depend on resolution; benchmarks rescale coordinates, so compare like with like.
  • Not segmentation. A dense set of tracks doesn't say which object each point belongs to, and cuts or long occlusions can attach a track to the wrong surface.
06

What runs here

Read
EntryIn CodeSplash
VID032 · TAPIRExplained here
VID033 · CoTrackerExplained here
07

Check: point tracking

Checkpoint

Check yourself

Why does adding up frame-to-frame flow drift over a long video?

Show the answer

Answer: a

Errors accumulate, and a hidden point has no true flow. Point trackers re-find points instead of only chaining.

Check yourself

How does TAPIR find a point that reappears after an occlusion?

Show the answer

Answer: b

Per-frame matching can re-find a point anywhere; temporal refinement then cleans up the trajectory.

Check yourself

A tracker reports a peak match score for a point in each frame. How should you use it?

Show the answer

Answer: b

Scores are similarities, not calibrated probabilities. Occlusion-aware benchmarks test the visibility calls directly.

Check yourself

What does CoTracker gain by tracking points jointly?

Show the answer

Answer: a

Attention between trajectories shares evidence among points that move together.

Check yourself

What is a risk of tracking points jointly?

Show the answer

Answer: b

Sharing evidence spreads mistakes as well as good estimates. Check tracks near occlusions and cuts.

Check yourself

Two point trackers are compared; one used the whole video at once, the other only frames up to the current one. What should the report say?

Show the answer

Answer: b

Offline and online tracking are different conditions; label them.

08

Recap

Recap
  • Chained flow drifts and can't see through occlusions.
  • Point trackers report a position and a visible-or-hidden call in every frame.
  • TAPIR matches each frame, then refines; CoTracker tracks points jointly, sharing evidence and mistakes.
  • Report online versus offline, query density and occlusion-aware scores.

Concepts in this lesson