CoTracker3
CoTracker3 (Meta AI, 2024): tracks any point through a video, all points jointly: a transformer refines the tracks with correlation features, attending over time and across tracks; offline (the whole video at once) and online (16-frame windows). Non-commercial: CC-BY-NC-4.0 code and weights.
experimental Fork of facebookresearch/co-tracker@82e02e8 · backends: portable, kernels
- Paper CoTracker3: Simpler and Better Point Tracking by Pseudo-Labelling Real Videos arXiv · first released 15 Oct 2024
Paper 2024 Added in 0.2.0 Evaluated with 0.2.0
Use it
pip install fastforks Lean install with only what this model needs: pip install "fastforks-core[nc]"
from fastforks import tracking
model = tracking.load("cotracker3-offline") # kernels on a supported GPU, else portable PyTorch
result = model(video, queries)
result.tracks # also: visibility
result.backend # what ran: mode, device, dtype, kernels The weights are non-commercial: fastforks downloads them only with FASTFORKS_NONCOMMERCIAL=1 set.
fastforks bench cotracker3-offline Times the model on this machine. load(…, mode="portable") or mode="kernels" picks a backend; usage guide.
Speed and memory
Every backend on one GPU (RTX 5060 Ti 16 GB) and the same input, the authors’ code included. Kernels runs fp16. Portable runs fp16 on CUDA.
Input: synthetic, 480x854 (the task’s standard size)
| Backend | dtype | Time per call (ms) | vs original fp16 | Peak memory allocated / reserved | Load (s) | First call (s) |
|---|---|---|---|---|---|---|
| Original fp32 | fp32 | not measured | – | – | – | – |
| Original fp16the authors' mixed-precision option (float16); facebookresearch/co-tracker@82e02e802975 as its predictor, offline (whole video, 6 x 6 support grid), frames resized to 384 x 512 | fp16 | 244 | – | 2,221 MiB/2,480 MiB | 0.3 | 0.32 |
| Portable fp32 | fp32 | not measured | – | – | – | – |
| Portable | fp16 | 162 | 1.5× | 755 MiB/882 MiB | 0.2 | 0.47 |
| Kernels | fp16 | 154 | 1.6× | 757 MiB/882 MiB | 0.3 | 0.49 |
| Portable + torch.compile | 135 | 1.8× | 755 MiB/902 MiB | 36 (build) | – | |
| TensorRT fp16 | fp16 | 25.9 | 9.4× | 284 MiBenginenot comparable | 157 (build) | – |
Measured on RTX 5060 Ti 16 GB, torch 2.14.1+cu130, 2026-11-14 to 2026-11-16. First call, 3 warm-up, peak reset, median of 3 rounds x median of 5. Ratios divide two
times of this table (same GPU, same input). Original fp16 is the authors’ own precision option, else torch.autocast. torch.compile and TensorRT: build time instead of load time. TensorRT memory (engine, not comparable) is the GPU memory the engine took, read from the driver because TensorRT allocates outside PyTorch, so it can't be compared with the PyTorch peaks of the other rows.
Other devices
| Device | Backend | dtype | ms / call | Peak memory | Output vs reference | Input |
|---|---|---|---|---|---|---|
| Apple M1 Pro 16 GB MPS, torch 2.14.1, 2026-11-17 | Portable | fp32 | 1430 | 4,725 MiB process | skip | 480x854 |
| Kernels | fp16 | not implemented | – | 480x854 | ||
CUDA memory is torch’s peak allocated / reserved; Apple has no such counter, so the Mac rows show the process footprint (weights, Python and torch included). “Output vs reference” compares the device’s output with the stored golden output under the card’s tolerance; – = not checked on that device. Kernels “not implemented” = no kernels for this model on that backend yet: it runs portable there.
Licence and weights
Non-commercial only
- Code
- CC-BY-NC-4.0 LICENSE.md
- Weights
- CC-BY-NC-4.0 source
- Training data
- Upstream paper: trained on synthetic Kubric MOVi-F sequences, then fine-tuned by pseudo-labelling about 15k real internet videos with other trackers (not released). No dataset entry here yet.
- code: CC-BY-NC-4.0 (noncommercial)
- weights: CC-BY-NC-4.0
Our reading of the licences, not legal advice.
Weights
scaled_offline.pth 102 MB· hosted on Hugging Facefastforks downloads and checks these files on first use (fastforks download cotracker3-offline). Non-commercial weights need FASTFORKS_NONCOMMERCIAL=1.
Accuracy
The test set through the authors’ code and through ours: same checkpoint, same protocol. The distance between the original’s fp32 and fp16 runs is what half precision alone costs; our runs should stay within it.
TAP-Vid DAVIS (query first)
every 3rd video, AJ / delta_avg / OA %
| Run | dtype | aj ↑ | delta_avg ↑ | oa ↑ | Δ aj vs fp32 original | videos | ms / video |
|---|---|---|---|---|---|---|---|
| Original fp32 | fp32 | 65.02 | 78.75 | 88.24 | reference | 10 | – |
| Original fp16 | fp16 | 65.08 | 78.78 | 88.27 | +0.06 | 10 | – |
| Portable fp32 | fp32 | 65.04 | 78.75 | 88.26 | +0.02 | 10 | – |
| Portable | fp16 | 65.07 | 78.75 | 88.26 | +0.05 | 10 | – |
| Kernels | fp16 | 65.06 | 78.72 | 88.27 | +0.04 | 10 | – |
Query-first TAP-Vid protocol: frames resized to 256 x 256 (PIL Lanczos) before the model (AllTracker: the original frames, resized by the model), one query per track at its first visible point, tracked online (TAPNext, Track-On) or over the whole clip (TAPIR, AllTracker, LocoTrack); AJ, delta_avg (< 1, 2, 4, 8, 16 px at 256 x 256) and occlusion accuracy averaged over the videos. Original = the authors’ code, same checkpoint and protocol. Measured on original fp32, original fp16: RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-14; portable fp32: RTX 5060 Ti, torch 2.14.1+cu130, fastforks bb4e8b64, 2026-11-17; portable, kernels: RTX 5060 Ti, torch 2.14.1+cu130, fastforks f104019b, 2026-11-14.
Closeness to the original
Beyond the test-set scores: the raw output of ours against the original’s fp32 output on the same input, pixel by pixel. CPU, float32: max |diff| <= 6e-05 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.0027 and p99 <= 0.014 (absolute error of the output tracks).
| Check | Tolerance | Measured |
|---|---|---|
| CPU fp32, max |diff| | ≤ 0.00006 | not recorded |
| GPU default dtypes, mean |diff| | ≤ 0.0027 | 0.00177 |
| GPU default dtypes, p99 |diff| | ≤ 0.014 | 0.00952 |
Recorded for cotracker3-offline on RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-15, with these kernels: fvm_conv
Details
CoTracker3 (Karaev et al., Meta AI 2024): tracking any point with a transformer that tracks all points jointly. A CNN encodes every frame at 384 x 512 into 128-channel features at 1/4 resolution (a 4-level pyramid); each track correlates the 7 x 7 neighbourhood of its current position with the 7 x 7 support of its query on every level (an MLP encodes the 4D correlation), and a transformer with attention over time and, through 64 virtual tracks, across tracks updates positions, visibility and confidence in 6 iterations. Offline: the whole video at once; online: sliding windows of 16 frames, 8 new frames per step.
- Input / output
- Input: a video (its frames in order) and query points
(t, x, y). Output: the position of every query in every frame and the probability that it is visible there. - Input size
- any H x W >= 32, padded to a multiple of 32; tested up to 3000x4000 (5,615 MiB allocated)
- Outputs
tracks,visibility- Checkpoint
online=false,window_len=60- CUDA kernels
fvm_convfused convolutions for image classifiers
- Apple (MPS)
- fp32
Limitations
- Frames are resized to 384 x 512 (the training size and that of upstream's predictor), whatever their size and aspect ratio.
- cotracker3-offline holds the features of every frame (about 4 MB per frame in float16); cotracker3-online processes 16-frame windows and only keeps the tracks.
- Visibility is upstream's score, rescaled so that 0.5 is upstream's threshold: the offline predictor's visibility > 0.9, the online predictor's visibility x confidence > 0.6.
- One video per call; all queries of a call share the video.
- cotracker3-online: the online window loop is data-dependent (6 graph breaks; `torch.export` guards on data), so no ONNX / TensorRT export; cotracker3-offline exports.
Full reference, generated from the repository
CoTracker3 (Meta AI, 2024): tracks any point through a video, all points jointly: a transformer refines the tracks with correlation features, attending over time and across tracks; offline (the whole video at once) and online (16-frame windows). Non-commercial: CC-BY-NC-4.0 code and weights.
Commercial use: no (code: CC-BY-NC-4.0 (noncommercial); weights: CC-BY-NC-4.0).
| variant | input | backend | time (ms) | peak memory (MiB, allocated / reserved) |
|---|---|---|---|---|
cotracker3-offline | synthetic (480x854) | original portable kernels portable + torch.compile TensorRT fp16 | 244 162 154 135 25.9 | 2221 / 2480 755 / 882 757 / 882 755 / 902 519 / 586 |
cotracker3-online | synthetic (480x854) | original portable kernels portable + torch.compile TensorRT fp16 | 328 184 176 159 planned for 0.2.1 | 1659 / 1886 755 / 906 757 / 888 701 / 846 – |
Details
- Original code: https://github.com/facebookresearch/co-tracker at
82e02e802975 - Code licence: CC-BY-NC-4.0 (noncommercial); files:
LICENSE.md - Weights licence: CC-BY-NC-4.0
- Licence evidence: https://github.com/facebookresearch/co-tracker/blob/82e02e8029753ad4ef13cf06be7f4fc5facdda4d/LICENSE.md (CC BY-NC 4.0); https://github.com/facebookresearch/co-tracker/blob/82e02e8029753ad4ef13cf06be7f4fc5facdda4d/README.md#license; https://huggingface.co/facebook/cotracker3/blob/bf55ea50d4390e1820a267f131cd6587240fb2c5/README.md (license: cc-by-nc-4.0)
- Training data: Upstream paper: trained on synthetic Kubric MOVi-F sequences, then fine-tuned by pseudo-labelling about 15k real internet videos with other trackers (not released). No dataset entry here yet.
- Kernel libraries:
fvm_conv - Variants:
cotracker3-offline,cotracker3-online - Not in this release (planned for 0.2.1):
cotracker3-onlineONNX / TensorRT export: torch.export fails (TorchExportError, step 1/3 of the ONNX export) - Outputs: tracks, visibility
- Input size: any H x W >= 32, padded to a multiple of 32
- Tested up to (portable, fp16, RTX 5060 Ti 16 GB):
cotracker3-offline3000x4000 (5.5 GiB peak allocated, 5.9 reserved);cotracker3-online3000x4000 (5.5 GiB peak allocated, 5.9 reserved) cotracker3-offline480x854, first call: portable + torch.compile 36 s (cold Inductor cache), TensorRT fp16 157 s (ONNX + engine).cotracker3-online480x854, first call: portable + torch.compile 38 s (cold Inductor cache).cotracker3-offlineoriginal 480x854: the authors' mixed-precision option (float16); facebookresearch/co-tracker@82e02e802975 as its predictor, offline (whole video, 6 x 6 support grid), frames resized to 384 x 512cotracker3-onlineoriginal 480x854: the authors' mixed-precision option (float16); facebookresearch/co-tracker@82e02e802975 as its predictor, online (16-frame windows, step 8), frames resized to 384 x 512cotracker3-offlineload / first call: original 0.65 s / 0.866 s, portable 0.28 s / 0.416 s, kernels 0.19 s / 0.52 scotracker3-onlineload / first call: original 0.54 s / 0.536 s, portable 0.27 s / 0.472 s, kernels 0.18 s / 0.515 s- Protocol, first call, 3 warm-up, peak reset, median of 3 rounds x median of 5
Measured
Query-first TAP-Vid protocol: frames resized to 256 x 256 (PIL Lanczos) before the model (AllTracker: the original frames, resized by the model), one query per track at its first visible point, tracked online (TAPNext, Track-On) or over the whole clip (TAPIR, AllTracker, LocoTrack); AJ, delta_avg (< 1, 2, 4, 8, 16 px at 256 x 256) and occlusion accuracy averaged over the videos. Original = the original code named under Details, same checkpoint and protocol.
| variant | dataset | original fp32 | original fp16 | portable | portable fp32 | kernels | note |
|---|---|---|---|---|---|---|---|
cotracker3-offline | TAP-Vid DAVIS (query first), every 3rd video, AJ / delta_avg / OA % | 65.02 / 78.75 / 88.24 | 65.08 / 78.78 / 88.27 | 65.07 / 78.75 / 88.26 | 65.04 / 78.75 / 88.26 | 65.06 / 78.72 / 88.27 | |
cotracker3-online | TAP-Vid DAVIS (query first), every 3rd video, AJ / delta_avg / OA % | 70.34 / 80.63 / 94.28 | 70.28 / 80.62 / 94.26 | 70.32 / 80.62 / 94.26 | 70.34 / 80.64 / 94.30 | 70.25 / 80.63 / 94.22 |
Measured on portable: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks f104019b, 2026-11-14; portable32: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks bb4e8b64, 2026-11-17; kernels: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks f104019b, 2026-11-14.
Parity
CPU, float32: max |diff| <= 6e-05 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.0027 and p99 <= 0.014 (absolute error of the output tracks).
| variant | kernels error vs original, mean / p99 | GPU, torch | kernels used |
|---|---|---|---|
cotracker3-offline | 0.00177 / 0.00952 | RTX 5060 Ti, torch 2.14.1+cu130 | fvm_conv@f1d064e539e1:sm_120 |
cotracker3-online | 0.00149 / 0.00738 | RTX 5060 Ti, torch 2.14.1+cu130 | fvm_conv@f1d064e539e1:sm_120 |
Limitations
- Frames are resized to 384 x 512 (the training size and that of upstream's predictor), whatever their size and aspect ratio.
- cotracker3-offline holds the features of every frame (about 4 MB per frame in float16); cotracker3-online processes 16-frame windows and only keeps the tracks.
- Visibility is upstream's score, rescaled so that 0.5 is upstream's threshold: the offline predictor's visibility > 0.9, the online predictor's visibility x confidence > 0.6.
- One video per call; all queries of a call share the video.
- cotracker3-online: the online window loop is data-dependent (6 graph breaks;
torch.exportguards on data), so no ONNX / TensorRT export; cotracker3-offline exports.
Example output
No example rendered for this checkpoint yet.