LocoTrack (fastforks)

LocoTrack (Cho et al., ECCV 2024): tracking any point offline over a whole video, TAPIR-like with local 4D correlation. A ResNet encodes every 256 x 256 frame at three resolutions; two cost volumes against the query's features give the initial position, visibility and uncertainty; then four refinements correlate the 7 x 7 neighbourhood of each track point with the 7 x 7 support of its query (a 4D correlation, encoded by small convs) and a transformer with ALiBi attention over the frames of each track corrects the whole track at once.

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/KU-CVLAB/LocoTrack at 3385a233a270.

Task: tracking. Tier: experimental. Outputs: tracks, visibility. Backends: portable, kernels.

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.

Variants

Weights are the authors' files (not hosted here). SHA-256 shortened to 12 hex digits; the full hashes are in card.toml.

variant weights (author link) SHA-256 weights licence commercial use
locotrack-b@1 locotrack_base.ckpt 8a5adbaeb610 Apache-2.0 yes
locotrack-s@1 locotrack_small.ckpt da023594e6d6 Apache-2.0 yes

Licence

Original-code strings, recorded as they are (research-use package; check them before any other use). Code: Apache-2.0. Licence files: LICENSE.

Training data: Upstream README: trained on the panning Kubric MOVi-E sequences (synthetic, released as hamacojr/LocoTrack-panning-MOVi-E). No dataset entry here yet..

Licence evidence: https://huggingface.co/datasets/hamacojr/LocoTrack-pytorch-weights/blob/a8754d0edfd9e53713dcb31ee21734aac8b727cf/README.md (license: apache-2.0); https://github.com/KU-CVLAB/LocoTrack/blob/3385a233a270160b253a69050c6a3934527f7775/LICENSE (Apache-2.0)

Input size

any H x W >= 32, padded to a multiple of 32 Tested up to (portable, fp16, RTX 5060 Ti 16 GB): locotrack-b 3000x4000 (5.5 GiB peak allocated, 5.9 reserved); locotrack-s 3000x4000 (5.4 GiB peak allocated, 5.8 reserved)

Speed and memory

Tracking, synthetic, 480x854

model time (ms): original portable kernels kernels speed-up: vs original vs portable peak memory (MiB, allocated / reserved): original portable kernels
locotrack-b 203 188 173 1.2x 1.1x 719 / 784 603 / 656 614 / 660
locotrack-s 193 180 151 1.3x 1.2x 706 / 812 759 / 842 596 / 642

Startup and first call

model load (s): original portable kernels first call (s): original portable kernels
locotrack-b 0.79 0.35 0.18 1.06 0.72 0.87
locotrack-s 0.29 0.06 1.13 0.23 0.65 0.66

torch.compile and TensorRT

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)
locotrack-b 480x854 188 ms 82.6 ms planned for 0.2.1 173 ms 146 s – 603 / 656 1117 / 1140 614 / 660 –
locotrack-s 480x854 180 ms 74.1 ms planned for 0.2.1 151 ms 140 s – 759 / 842 1000 / 1034 596 / 642 –

Fixed-size cells: time (ms) / peak allocated / peak reserved memory (MiB).

Hardware, protocol and caveats: benchmarks (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.

Accuracy

On public datasets

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 kernels note
locotrack-b TAP-Vid DAVIS (query first), every 3rd video, AJ / delta_avg / OA % 67.19 / 78.05 / 89.58 67.31 / 78.11 / 89.85 67.31 / 78.07 / 89.89 67.29 / 78.10 / 89.83

Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks db9e79d5, 2026-11-13.

Parity with the original code

Every variant is checked against reference outputs of the original code at its pinned commit. CPU, float32: max |diff| <= 2.3e-05 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.0036 and p99 <= 0.021 (absolute error of the output tracks).

Limitations

  • Offline: the whole video is encoded before tracking (features of every frame in memory, about 7 MB per frame in float32); for live video use an online tracker (TAPNext, Track-On2).
  • 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 is not ported.
  • One video per call; all queries of a call share the video.

Usage

from fastforks import tracking

model = tracking.load("locotrack-b")  # mode="auto": the preferred backend from recorded measurements
result = model(frames, [[0, x, y]])  # frames: the video's images in order; queries (t, x, y)
result.tracks  # [T, Q, 2] float32: x, y in input pixels; result.visible [T, Q] bool
result.backend  # what ran, e.g. Backend(mode='portable', device='cuda:0', dtype='float16')

Install with pip install fastforks (see https://github.com/kleinicke/fastforks). Other variants: locotrack-b, locotrack-s.

Kernels backend

tracking.load("locotrack-b", 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.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Collection including fastforks/locotrack