TAPIR
TAPIR and BootsTAPIR (Google DeepMind, 2023 / 2024): track any point through a whole video offline: a per-frame match from a cost volume, then four temporal refinement passes; BootsTAPIR adds self-training on real videos. Apache-2.0 code and weights.
experimental Fork of google-deepmind/tapnet@ceedd60 · backends: portable, kernels
- Paper BootsTAP: Bootstrapped Training for Tracking-Any-Point ACCV 2024 · first released 1 Feb 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
from fastforks import tracking
model = tracking.load("bootstapir") # kernels on a supported GPU, else portable PyTorch
result = model(video, queries)
result.tracks # also: visibility
result.backend # what ran: mode, device, dtype, kernels fastforks bench bootstapir 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); upstream BootsTAPIR, offline (whole video); frames resized to 256 x 256 | fp16 | 243 | – | 639 MiB/774 MiB | 0.5 | 0.46 |
| Portable fp32 | fp32 | not measured | – | – | – | – |
| Portable | fp16 | 234 | 1.0× | 508 MiB/628 MiB | 0.3 | 0.80 |
| Kernels | fp16 | 192 | 1.3× | 508 MiB/628 MiB | 1.1 | 0.66 |
| Portable + torch.compile | 183 | 1.3× | 758 MiB/832 MiB | 207 (build) | – | |
| TensorRT fp16 | fp16 | 13.2 | 18× | 204 MiBenginenot comparable | 65 (build) | – |
Measured on RTX 5060 Ti 16 GB, torch 2.14.1+cu130, 2026-11-12 to 2026-11-13. 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-14 | Original | fp32 | 1930 | 2,931 MiB process | – | 480x854 |
| Portable | fp16 | 2059 | 1,750 MiB process | matches | 480x854 | |
| Portable | fp32 | 1721 | 2,769 MiB process | matches | 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
Commercial use allowed
- Code
- Apache-2.0 LICENSE
- Weights
- Apache-2.0 source
- Training data
- Upstream: TAPIR is trained on synthetic Kubric MOVi-E sequences (the panning variant); BootsTAPIR is further trained with BootsTAP self-training on about 15 million unlabelled real video clips (not released). None has a dataset entry here yet.
Our reading of the licences, not legal advice.
Weights
bootstapir_checkpoint_v2.pt 219 MB· hosted on Google Drivefastforks downloads and checks these files on first use (fastforks download bootstapir).
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.49 | 76.75 | 92.56 | reference | 10 | – |
| Original fp16 | fp16 | 65.53 | 76.72 | 92.55 | +0.04 | 10 | – |
| Portable fp32 | fp32 | 65.49 | 76.76 | 92.58 | ±0.00 | 10 | – |
| Portable | fp16 | 65.56 | 76.78 | 92.44 | +0.07 | 10 | – |
| Kernels | fp16 | 65.51 | 76.72 | 92.51 | +0.02 | 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-12; 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 8d5bccf, 2026-11-12.
TAP-Vid DAVIS (query first)
AJ / delta_avg / OA %
| Run | dtype | aj ↑ | delta_avg ↑ | oa ↑ | Δ aj vs fp32 original | videos | ms / video |
|---|---|---|---|---|---|---|---|
| Original fp32 | fp32 | 62.27 | 74.62 | 89.67 | reference | 30 | – |
| Original fp16 | not measured | ||||||
| Portable fp32 | fp32 | 62.26 | 74.59 | 89.68 | −0.01 | 30 | – |
| Portable | fp16 | 62.29 | 74.61 | 89.66 | +0.02 | 30 | – |
| Kernels | fp16 | 62.27 | 74.61 | 89.64 | ±0.00 | 30 | – |
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: RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-13; 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 8d5bccf, 2026-11-13.
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| <= 3.5e-05 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.0079 and p99 <= 0.028 (absolute error of the output tracks).
| Check | Tolerance | Measured |
|---|---|---|
| CPU fp32, max |diff| | ≤ 0.000035 | not recorded |
| GPU default dtypes, mean |diff| | ≤ 0.0079 | 0.00524 |
| GPU default dtypes, p99 |diff| | ≤ 0.028 | 0.01845 |
Recorded for bootstapir on RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-12, with these kernels: fvm_conv
Details
TAPIR (Doersch, Yang, Vecerik et al., Google DeepMind 2023) and BootsTAPIR (Doersch et al. 2024, the same network trained further with BootsTAP self-training on unlabelled real videos): tracking any point offline over a whole video. A ResNet encodes every 256 x 256 frame; per frame, a cost volume against the query's features gives the initial position, visibility and uncertainty, then four PIPs-style refinements (local correlations, a depthwise-conv MLP mixer over the frames of each track) correct the whole track at once.
- 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,747 MiB allocated)
- Outputs
tracks,visibility- CUDA kernels
fvm_convfused convolutions for image classifiers
- Apple (MPS)
- fp32, fp16
Limitations
- Offline: the whole video is encoded before tracking (features of every frame in memory, about 3 MB per frame); for live video use an online tracker (TAPNext).
- Frames are resized to 256 x 256 (the training size and that of upstream's TAP-Vid numbers), whatever their size and aspect ratio. Upstream's higher-resolution refinement (best at 512 x 512 for BootsTAPIR) is not ported.
- One video per call; all queries of a call share the video.
Full reference, generated from the repository
TAPIR and BootsTAPIR (Google DeepMind, 2023 / 2024): track any point through a whole video offline: a per-frame match from a cost volume, then four temporal refinement passes; BootsTAPIR adds self-training on real videos. Apache-2.0 code and weights.
Commercial use: yes.
| variant | input | backend | time (ms) | peak memory (MiB, allocated / reserved) |
|---|---|---|---|---|
bootstapir | synthetic (480x854) | original portable kernels portable + torch.compile TensorRT fp16 | 243 234 192 183 13.2 | 639 / 774 508 / 628 508 / 628 758 / 832 492 / 532 |
tapir | synthetic (480x854) | original portable kernels portable + torch.compile TensorRT fp16 | 187 182 141 131 6.47 | 498 / 574 463 / 548 463 / 548 630 / 752 361 / 406 |
Details
- Original code: https://github.com/google-deepmind/tapnet at
ceedd60bb9f6 - Code licence: Apache-2.0 (permissive); files:
LICENSE - Weights licence: Apache-2.0
- Licence evidence: https://github.com/google-deepmind/tapnet/blob/ceedd60bb9f6c9f7c74796e4445aff6c6ddf7c9b/README.md#license-and-disclaimer
- Training data: Upstream: TAPIR is trained on synthetic Kubric MOVi-E sequences (the panning variant); BootsTAPIR is further trained with BootsTAP self-training on about 15 million unlabelled real video clips (not released). None has a dataset entry here yet.
- Kernel libraries:
fvm_conv - Variants:
bootstapir,tapir - 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):
bootstapir3000x4000 (5.6 GiB peak allocated, 6.1 reserved);tapir3000x4000 (5.5 GiB peak allocated, 6.0 reserved) bootstapir480x854, first call: portable + torch.compile 207 s (cold Inductor cache), TensorRT fp16 65 s (ONNX + engine).tapir480x854, first call: portable + torch.compile 169 s (cold Inductor cache), TensorRT fp16 55 s (ONNX + engine).bootstapiroriginal 480x854: the authors' mixed-precision option (float16); upstream BootsTAPIR, offline (whole video); frames resized to 256 x 256tapiroriginal 480x854: the authors' mixed-precision option (float16); upstream TAPIR, offline (whole video); frames resized to 256 x 256bootstapirload / first call: original 0.6 s / 0.901 s, portable 0.32 s / 0.8 s, kernels 1.14 s / 0.659 stapirload / first call: original 0.35 s / 0.827 s, portable 0.19 s / 0.836 s, kernels 1.13 s / 0.688 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 |
|---|---|---|---|---|---|---|---|
bootstapir | TAP-Vid DAVIS (query first), every 3rd video, AJ / delta_avg / OA % | 65.49 / 76.75 / 92.56 | 65.53 / 76.72 / 92.55 | 65.56 / 76.78 / 92.44 | 65.49 / 76.76 / 92.58 | 65.51 / 76.72 / 92.51 | |
bootstapir | TAP-Vid DAVIS (query first), AJ / delta_avg / OA % | 62.27 / 74.62 / 89.67 | 62.29 / 74.61 / 89.66 | 62.26 / 74.59 / 89.68 | 62.27 / 74.61 / 89.64 | ||
tapir | TAP-Vid DAVIS (query first), every 3rd video, AJ / delta_avg / OA % | 62.63 / 74.54 / 90.14 | 62.62 / 74.60 / 90.18 | 62.74 / 74.59 / 90.11 | 62.62 / 74.51 / 90.14 | 62.73 / 74.55 / 90.21 |
Measured on portable: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 8d5bccf, 2026-11-12 to 2026-11-13; 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 8d5bccf, 2026-11-12 to 2026-11-13.
Parity
CPU, float32: max |diff| <= 3.5e-05 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.0079 and p99 <= 0.028 (absolute error of the output tracks).
| variant | kernels error vs original, mean / p99 | GPU, torch | kernels used |
|---|---|---|---|
bootstapir | 0.00524 / 0.01845 | RTX 5060 Ti, torch 2.14.1+cu130 | fvm_conv@f1d064e539e1:sm_120 |
tapir | 0.0036 / 0.01425 | RTX 5060 Ti, torch 2.14.1+cu130 | fvm_conv@f1d064e539e1:sm_120 |
Limitations
- Offline: the whole video is encoded before tracking (features of every frame in memory, about 3 MB per frame); for live video use an online tracker (TAPNext).
- Frames are resized to 256 x 256 (the training size and that of upstream's TAP-Vid numbers), whatever their size and aspect ratio. Upstream's higher-resolution refinement (best at 512 x 512 for BootsTAPIR) is not ported.
- One video per call; all queries of a call share the video.
Example output
No example rendered for this checkpoint yet.