Flor commited on
Commit
477acc2
Β·
verified Β·
1 Parent(s): 5f2aea0

card: update from fastforks 1cbf1671

Browse files
Files changed (1) hide show
  1. README.md +115 -0
README.md ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: "fastforks"
3
+ pipeline_tag: "keypoint-detection"
4
+ license: "apache-2.0"
5
+ tags:
6
+ - "tracking"
7
+ - "point-tracking"
8
+ - "tracking-any-point"
9
+ - "video"
10
+ - "cuda"
11
+ - "pytorch"
12
+ - "fastforks"
13
+ - "fastforks-card"
14
+ ---
15
+ # TAPNext (fastforks)
16
+
17
+ TAPNext (Zholus, Doersch, Yang, Koppula et al., Google DeepMind 2025): tracking any point as next-token prediction. A TRecViT-B (12 blocks, each a gated linear recurrence over time per token and a ViT layer over the tokens of a frame) reads 8 x 8 patches of 256 x 256 frames plus one token per query point and predicts, frame by frame, the point's position (512-bin classification, windowed soft-argmax) and whether it is visible. Online: each frame only sees the past.
18
+
19
+ This repo is the model card only: it holds no weights. fastforks downloads the authors' weights from the links below and checks them against the SHA-256 in the model card. Code: <https://github.com/kleinicke/fastforks>. Kernels for the `kernels` backend: <https://huggingface.co/fastforks/kernels>. Original code: <https://github.com/google-deepmind/tapnet> at `ceedd60bb9f6`.
20
+
21
+ Task: tracking. Tier: experimental. Outputs: `tracks`, `visibility`. Backends: `portable`, `kernels`.
22
+
23
+ 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.
24
+
25
+ ## Variants
26
+
27
+ Weights are the authors' files (not hosted here). SHA-256 shortened to 12 hex digits; the full hashes are in [`card.toml`](https://github.com/kleinicke/fastforks/blob/main/src/fastforks/tracking/models/tapnext/card.toml).
28
+
29
+ | variant | weights (author link) | SHA-256 | weights licence | commercial use |
30
+ |---|---|---|---|---|
31
+ | `tapnext@1` | [bootstapnext_ckpt.npz](https://storage.googleapis.com/dm-tapnet/tapnext/bootstapnext_ckpt.npz) | `19de6b149555` | Apache-2.0 | yes |
32
+ | `tapnext-pp@1` | [tapnextpp_ckpt.pt](https://storage.googleapis.com/dm-tapnet/tapnextpp/tapnextpp_ckpt.pt) | `cb96a43444cc` | Apache-2.0 | yes |
33
+
34
+ ## Licence
35
+
36
+ Original-code strings, recorded as they are (research-use package; check them before any other use). Code: Apache-2.0. Licence files: `LICENSE`.
37
+
38
+ Training data: Upstream: TAPNext is trained on synthetic Kubric MOVi-F sequences and fine-tuned with BootsTAP self-training on unlabelled real videos (not released); TAPNext++ is further fine-tuned on PointOdyssey and Kubric-1024 (1024-frame synthetic sequences). None has a dataset entry here yet..
39
+
40
+ Licence evidence: <https://github.com/google-deepmind/tapnet/blob/ceedd60bb9f6c9f7c74796e4445aff6c6ddf7c9b/README.md#license-and-disclaimer>
41
+
42
+ ## Input size
43
+
44
+ any H x W >= 32, padded to a multiple of 32
45
+ Tested up to (portable, fp16, RTX 5060 Ti 16 GB): `tapnext` 3000x4000 (4.3 GiB peak allocated, 4.5 reserved); `tapnext-pp` 3000x4000 (4.3 GiB peak allocated, 4.5 reserved)
46
+
47
+ ## Speed and memory
48
+
49
+ ### Tracking, synthetic, 480x854
50
+
51
+ | model | time (ms): original | portable | kernels | kernels speed-up: vs original | vs portable | peak memory (MiB, allocated / reserved): original | portable | kernels |
52
+ | --- | --- | --- | --- | --- | --- | --- | --- | --- |
53
+ | `tapnext` | 909 | 529 | 382 | 2.4x | 1.4x | 1721 / 1902 | 1220 / 1294 | 1313 / 1374 |
54
+ | `tapnext-pp` | 1493 | 529 | – | – | – | 1527 / 1718 | 1220 / 1294 | – |
55
+
56
+ ### Startup and first call
57
+
58
+ | model | load (s): original | portable | kernels | first call (s): original | portable | kernels |
59
+ | --- | --- | --- | --- | --- | --- | --- |
60
+ | `tapnext` | 16.92 | 2.72 | 2.63 | 2.17 | 0.69 | 0.56 |
61
+ | `tapnext-pp` | 4.83 | 1.34 | – | 1.80 | 0.77 | – |
62
+
63
+ ### torch.compile and TensorRT
64
+
65
+ | model | input | time: portable | compile | TensorRT fp16 | kernels | preparation: compile (cold first call) | ONNX + engine build | peak MiB (alloc / reserved): portable | compile | kernels | TensorRT (engine + torch) |
66
+ | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
67
+ | `tapnext` | 480x854 | 529 ms | 398 ms | deferred (build >5 min) | 382 ms | 40.5 s | – | 1220 / 1294 | 1164 / 1272 | 1313 / 1374 | – |
68
+ | `tapnext-pp` | 480x854 | 529 ms | planned for 0.2.1 | – | – | – | – | 1220 / 1294 | – | – | – |
69
+
70
+ Fixed-size cells: time (ms) / peak allocated / peak reserved memory (MiB).
71
+
72
+ Hardware, protocol and caveats: [benchmarks](https://github.com/kleinicke/fastforks/blob/main/docs/benchmarks.md) (RTX 5060 Ti 16 GB, sm_120). Original = the original code named above at the precision of portable (fp16, or `(fp32)` where fp16 is unsupported or not finite); original fp32 = its default fp32 run. Peak memory is the torch allocator's.
73
+
74
+ ## Accuracy
75
+
76
+ ### On public datasets
77
+
78
+ 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.
79
+
80
+ | variant | dataset | original fp32 | original fp16 | portable | kernels | note |
81
+ |---|---|---|---|---|---|---|
82
+ | `tapnext` | TAP-Vid DAVIS (query first), every 3rd video, AJ / delta_avg / OA % | 71.01 / 82.01 / 95.18 | 71.02 / 82.02 / 95.19 | 71.02 / 82.02 / 95.19 | 71.02 / 82.03 / 95.23 | |
83
+ | `tapnext` | TAP-Vid DAVIS (query first), AJ / delta_avg / OA % | 66.55 / 79.48 / 92.16 | 66.55 / 79.49 / 92.17 | 66.55 / 79.49 / 92.17 | 66.56 / 79.50 / 92.18 | |
84
+ | `tapnext-pp` | TAP-Vid DAVIS (query first), every 3rd video, AJ / delta_avg / OA % | 71.48 / 82.43 / 94.96 | 71.50 / 82.43 / 94.96 | 71.50 / 82.43 / 94.96 | 71.47 / 82.41 / 94.98 | |
85
+
86
+ Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-12.
87
+
88
+ ### Parity with the original code
89
+
90
+ Every variant is checked against reference outputs of the original code at its pinned commit. CPU, float32: max |diff| <= 4.6e-05 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.0063 and p99 <= 0.036 (absolute error of the output `tracks`).
91
+
92
+ ## Limitations
93
+
94
+ - Online, causal: a point is tracked from its query frame on; in frames before it the model has no information (the tracks there are its guess, with a low visibility). Query on the first frame, or run the reversed video for the backward part.
95
+ - Frames are resized to 256 x 256 (the training size), whatever their size and aspect ratio.
96
+ - One video per call; all queries of a call share the video.
97
+
98
+ ## Usage
99
+
100
+ ```python
101
+ from fastforks import tracking
102
+
103
+ model = tracking.load("tapnext") # mode="auto": the preferred backend from recorded measurements
104
+ result = model(frames, [[0, x, y]]) # frames: the video's images in order; queries (t, x, y)
105
+ result.tracks # [T, Q, 2] float32: x, y in input pixels; result.visible [T, Q] bool
106
+ result.backend # what ran, e.g. Backend(mode='portable', device='cuda:0', dtype='float16')
107
+ ```
108
+
109
+ Install with `pip install fastforks` (see <https://github.com/kleinicke/fastforks>). Other variants: `tapnext`, `tapnext-pp`.
110
+
111
+ ## Kernels backend
112
+
113
+ `tracking.load("tapnext", mode="kernels")` runs our CUDA kernels (`fvm_conv`). It needs a prebuilt kernel for your GPU architecture (downloaded from <https://huggingface.co/fastforks/kernels> on first use) and a recent NVIDIA driver; if there is none it raises `BackendUnavailableError` with the reason and never falls back silently. `mode="auto"` picks `kernels` when it can run and logs the choice.
114
+
115
+ <!-- staged from fastforks 1cbf1671 (2026-11-15) -->