Point Tracking for 4DGS
This repo is the point tracking Python extension for 4D Gaussian Splatting. It wraps sequence point trackers such as CoTracker3, VGGT, MV-TAP, OpenD4RT, MV-RoMa, UniFlowMatch, and torchvision RAFT behind one small registry, then applies them either to plain image sequences or to multi-timestep Gaussian Splatting camera datasets.
The package provides three common workflows:
- track sampled 2D points through one ordered image sequence
- project 3D Gaussians into a reference timestep, track those projected points across all timesteps, and attach the resulting tracks back to Gaussian Splatting camera datasets
- build supervision samples (query, frames, and per-view tracks) from camera datasets, a trained 3DGS point cloud, or a Blender scene, and save them for later training
Features
- Organised as a standard Python package with
pip installsupport - Shared point tracker registry with
cotracker3,vggt,vggsfm,mvtap,d4rt,mvroma,uniflowmatch,raft,dot, andblender - Single-view image sequence tracking and rendering
- Multi-timestep Gaussian Splatting camera dataset tracking
- Point batching inside trackers that take a constructor
batch_size - Camera dataset reordering against a selected reference timestep
- Blender mesh tracking for scenes rendered by NVS2COLMAP
- Supervision datasets (
tracker,gstracker,blender) that save query, frames, and tracks - Port the motion estimation workflow from TrackerSplat for point-tracker-driven motion synthesis
- Regularize 3DGS training with point tracker trajectories
Install
Prerequisites
- PyTorch (CUDA build recommended)
- CUDA Toolkit matching your PyTorch installation
gaussian-splatting>= 2.12.0
pip install track-4dgs also installs Pillow, einops, timm, PyYAML, numpy, opencv-python, warp-lang, huggingface_hub, safetensors, hydra-core, and omegaconf.
The published wheel leaves out Git dependencies. Install them for the trackers that need them:
pip install wheel setuptools
pip install --upgrade "gaussian-splatting>=2.12.0"
# cotracker3
pip install --upgrade git+https://github.com/facebookresearch/co-tracker.git@main
# VGGT COLMAP demo only. vggt and vggsfm point tracking do not import LightGlue.
pip install --upgrade "git+https://github.com/jytime/LightGlue.git#egg=lightglue"
# uniflowmatch and mvroma
pip install --upgrade "git+https://github.com/castacks/UniCeption.git@ee7fa0b50d8295b3f0485e42c1d133fb534bfce7"
mvroma, uniflowmatch, dot, and vggt ship inside this package. Their source trees are the submodules/MV-RoMa, submodules/UFM, submodules/dot, and submodules/vggt submodules, so a source install needs git clone --recursive.
If you have trouble with gaussian-splatting, try installing it from source:
pip install wheel setuptools
pip install --upgrade git+https://github.com/yindaheng98/gaussian-splatting.git@master --no-build-isolation
PyPI Install
pip install --upgrade track-4dgs
or build latest from source:
pip install wheel setuptools
pip install --upgrade git+https://github.com/yindaheng98/track-4dgs.git@master --no-build-isolation
Development Install
git clone --recursive https://github.com/yindaheng98/track-4dgs.git
cd track-4dgs
pip install --target . --upgrade . --no-deps
--no-deps skips everything in Prerequisites. Install those packages first.
Download Checkpoints
CoTracker3 offline checkpoint (cotracker3, default checkpoints/scaled_offline.pth):
mkdir -p checkpoints
wget -P checkpoints https://huggingface.co/facebook/cotracker3/resolve/main/scaled_offline.pth
DOT (dot). -m model="'dot'" uses the CoTracker2 initializer. Other names are cotracker3, tapir, and bootstapir. cotracker3 reuses checkpoints/scaled_offline.pth from the download above. The RAFT estimator and refiner are shared:
mkdir -p checkpoints
wget -P checkpoints https://huggingface.co/16lemoing/dot/resolve/main/cvo_raft_patch_8.pth
wget -P checkpoints https://huggingface.co/16lemoing/dot/resolve/main/movi_f_raft_patch_4_alpha.pth
wget -P checkpoints https://huggingface.co/16lemoing/dot/resolve/main/movi_f_cotracker2_patch_4_wind_8.pth
wget -P checkpoints https://huggingface.co/16lemoing/dot/resolve/main/panning_movi_e_tapir.pth
wget -P checkpoints https://huggingface.co/16lemoing/dot/resolve/main/panning_movi_e_plus_bootstapir.pth
VGGT commercial checkpoint (vggt, default checkpoints/vggt_1B_commercial.pt):
mkdir -p checkpoints
wget -P checkpoints https://huggingface.co/facebook/VGGT-1B-Commercial/resolve/main/vggt_1B_commercial.pt --header="Authorization: Bearer $HF_TOKEN"
If the VGGT checkpoint is not present, VGGTPointTracker falls back to VGGT.from_pretrained("facebook/VGGT-1B"). VGGT reads query features from frame 0, so every query frame index must be 0.
VGGSfM tracker checkpoint (vggsfm, default checkpoints/vggsfm_v2_tracker.pt):
mkdir -p checkpoints
wget -P checkpoints https://huggingface.co/facebook/VGGSfM/resolve/main/vggsfm_v2_tracker.pt
If the checkpoint is not present, load_vggsfm downloads it from that URL.
MV-TAP checkpoint (mvtap, default checkpoints/mvtap.ckpt, from the MV-TAP release):
mkdir -p checkpoints
# save the downloaded file as checkpoints/mvtap.ckpt
MV-RoMa checkpoint (mvroma, default checkpoints/outdoor_final.pth, from the MV-RoMa release). Indoor weights are here. The tracker also downloads infinity1096/UFM-Refine as its prematcher. It runs on CUDA and accepts at most 31 reference frames.
mkdir -p checkpoints
# save the downloaded file as checkpoints/outdoor_final.pth
UniFlowMatch (uniflowmatch) downloads a Hugging Face repo on first use. -m model="'base'" selects infinity1096/UFM-Base. Other names are refine, base-980, refine-980, base-dinov2l-init, and base-dinov2g-init.
RAFT (raft) uses torchvision raft_large (optical flow tutorial). Weights download on first use. -m model="'small'" selects raft_small. -m num_flow_updates=12 is the iteration count; the last flow is the track. -m max_resolution=512 shrinks a frame only when its long side is above 512. Smaller frames keep their own size. The model has no input resize of its own, and its correlation volume is quadratic in the resolution it receives.
OpenD4RT checkpoint and model config (d4rt, default checkpoints/OpenD4RT_48CLIP_9Mix_NoCropAUG/opend4rt.ckpt):
# 48-frame model
mkdir -p checkpoints/OpenD4RT_48CLIP_9Mix_NoCropAUG
wget -P checkpoints/OpenD4RT_48CLIP_9Mix_NoCropAUG https://huggingface.co/Lijiaxin0111/OpenD4RT/resolve/main/checkpoints/OpenD4RT_48CLIP_9Mix_NoCropAUG/opend4rt.ckpt
wget -P checkpoints/OpenD4RT_48CLIP_9Mix_NoCropAUG https://huggingface.co/Lijiaxin0111/OpenD4RT/resolve/main/checkpoints/OpenD4RT_48CLIP_9Mix_NoCropAUG/model.yaml
# 32-frame model
mkdir -p checkpoints/OpenD4RT_32CLIP_9Dataset_NoAUG
wget -P checkpoints/OpenD4RT_32CLIP_9Dataset_NoAUG https://huggingface.co/Lijiaxin0111/OpenD4RT/resolve/main/checkpoints/OpenD4RT_32CLIP_9Dataset_NoAUG/opend4rt.ckpt
wget -P checkpoints/OpenD4RT_32CLIP_9Dataset_NoAUG https://huggingface.co/Lijiaxin0111/OpenD4RT/resolve/main/checkpoints/OpenD4RT_32CLIP_9Dataset_NoAUG/model.yaml
Each model requires both opend4rt.ckpt and its adjacent model.yaml. Pass either the checkpoint file or its containing directory through the checkpoint tracker option.
Download Datasets
DexYCB (CC BY-NC 4.0). Download the per-folder archives from the project page. Each subject is 12G. bop.tar.gz is 1.2G, models.tar.gz is 1.4G, and calibration.tar.gz is 16K. gdown downloads each Google Drive file. The loop extracts every archive into data/dex-ycb. That directory is DEX_YCB_DIR for dex-ycb-toolkit: 20200709-subject-01/ through 20201022-subject-10/, plus calibration/ and models/.
pip install gdown
mkdir -p data/dex-ycb
while read -r name id; do
[ -n "$name" ] || continue
gdown "$id" -O "data/dex-ycb/$name" &&
tar -C data/dex-ycb -zxvf "data/dex-ycb/$name"
done <<'EOF'
20200709-subject-01.tar.gz 1Ehh92wDE3CWAiKG7E9E73HjN2Xk2XfEk
20200813-subject-02.tar.gz 1Uo7MLqTbXEa-8s7YQZ3duugJ1nXFEo62
20200820-subject-03.tar.gz 1FkUxas8sv8UcVGgAzmSZlJw1eI5W5CXq
20200903-subject-04.tar.gz 14up6qsTpvgEyqOQ5hir-QbjMB_dHfdpA
20200908-subject-05.tar.gz 1NBA_FPyGWOQF5-X9ueAat5g8lDMz-EmS
20200918-subject-06.tar.gz 1UWIN2-wOBZX2T0dkAi4ctAAW8KffkXMQ
20200928-subject-07.tar.gz 1oWEYD_o3PVh39pLzMlJcArkDtMj4nzI0
20201002-subject-08.tar.gz 1GTNZwhWbs7Mfez0krTgXwLPndvrw1Ztv
20201015-subject-09.tar.gz 1j0BLkaCjIuwjakmywKdOO9vynHTWR0UH
20201022-subject-10.tar.gz 1FvFlRfX-p5a5sAWoKEGc17zKJWwKaSB-
bop.tar.gz 1CPqLjsaYNjE3xSJbuWmqaMsGvyGIxiKL
calibration.tar.gz 1UAwVKT4Rgb1fLcFoa1o71_-0NtSvvLAQ
models.tar.gz 1cAzlQBpcTatI5ykYQ8ziQiHLUG_a_UpM
EOF
Harmony4D (project page, download notes). Each sequence has about 20 synchronized exo GoPro cameras. The repo is about 352G of zip archives under train/ and test/, licensed under MIT. hf download writes them to data/harmony4d. Install the Hugging Face CLI if hf is not on PATH.
mkdir -p data/harmony4d
hf download Jyun-Ting/Harmony4D --type dataset --local-dir data/harmony4d
One sequence is the same command with --include. train/04_sword is split across train/04_sword_part1.zip and train/04_sword_part2.zip.
hf download Jyun-Ting/Harmony4D --type dataset --include "train/01_hugging.zip" --local-dir data/harmony4d
Unzip each archive inside train/ or test/. The download notes expect one sequence folder per activity:
for z in data/harmony4d/train/*.zip data/harmony4d/test/*.zip; do
unzip -n -d "$(dirname "$z")" "$z"
done
data/harmony4d/
├── train/
│ ├── 01_hugging/
│ ├── 02_grappling/
│ └── ...
└── test/
├── 01_hugging/
├── 03_grappling2/
└── ...
CMU Panoptic Studio (ver 1.2 sequence list) is released for non-commercial research use. The released set is 84 sequences under http://domedb.perception.cs.cmu.edu/webdata/dataset/<sequence>/: range of motion, haggling, musical instruments, ultimatum, mafia, dance, toddler, office, and pizza. 171204_pose1_sample is a short clip of 171204_pose1 (31 HD videos, 271MB, no VGA). The dataset browser also lists later sequences; add a name to the loop to fetch it from the same paths. If the CMU host does not answer, replace http://domedb.perception.cs.cmu.edu with http://vcl.snu.ac.kr/panoptic.
PanopticSpec.load reads calibration_<sequence>.json, hdPose3d_stage1_coco19/body3DScene_XXXXXXXX.json, and videos/hd_shared_crf20/hd_00_00.mp4 through hd_00_30.mp4. The loop keeps the 53 sequences where that coco19 archive contains the body jsons and all 31 HD videos are on the host.
170224_haggling_a1 is left out because hdPose3d_stage1_coco19.tar is a 10KB archive of an empty directory. 171204_pose3, 171204_pose4, and 171204_pose5 have no hd_00_20.mp4. 171204_pose6 and 160224_haggling1 have no hd_00_21.mp4. 160422_haggling1 has no hd_00_20.mp4 or hd_00_21.mp4. Calibration for those six still names the missing cameras.
These sequences have no hdPose3d_stage1_coco19.tar: 171026_cello1, 171026_cello2, 160226_ultimatum1, 160224_ultimatum1, 160224_ultimatum2, 160422_mafia2, 160226_mafia1, 160226_mafia2, 160224_mafia1, 160224_mafia2, 170307_dance1, 170307_dance2, 170307_dance3, 170307_dance4, 170307_dance6, 170915_toddler2, 170915_toddler3, 170915_toddler4, 160401_ian1, 160401_ian2, 160401_ian3, 160317_moonbaby1, 160317_moonbaby2, and 160317_moonbaby3. 160226_ultimatum1, 160224_ultimatum1, 160224_ultimatum2, the five mafia sequences, 170307_dance1, and 160401_ian1 through 160401_ian3 publish hdPose3d_stage1.tar and vgaPose3d_stage1.tar instead. 160317_moonbaby1 publishes vgaPose3d_stage1.tar. The three moonbaby sequences have no HD videos.
Each sequence is saved under data/panoptic/<sequence>/. calibration_<sequence>.json and videos/hd_shared_crf20/hd_00_00.mp4 through hd_00_30.mp4 are written as files. hdPose3d_stage1_coco19.tar, hdFace3d.tar, hdHand3d.tar, and hdMeshTrack_face.tar are piped to tar and extracted in that directory. 161029_piano2, 161029_piano3, 160906_band1, 160906_band2, 160906_band3, 160906_ian2, 160906_ian3, and 160906_ian5 have no face or hand archive. This loop skips VGA. It needs wget and tar. Videos stay mp4. A missing file makes wget fail; a partial saved file is deleted, and the loop continues. The 271MB figure above is the sample's compressed HD video.
mkdir -p data/panoptic
set -o pipefail
while read -r seq; do
[ -n "$seq" ] || continue
mkdir -p "data/panoptic/$seq/videos/hd_shared_crf20"
wget --tries=2 --timeout=60 -O - \
"http://domedb.perception.cs.cmu.edu/webdata/dataset/$seq/hdPose3d_stage1_coco19.tar" \
| tar -C "data/panoptic/$seq" -xf - \
|| true
wget --tries=2 --timeout=60 -O - \
"http://domedb.perception.cs.cmu.edu/webdata/dataset/$seq/hdFace3d.tar" \
| tar -C "data/panoptic/$seq" -xf - \
|| true
wget --tries=2 --timeout=60 -O - \
"http://domedb.perception.cs.cmu.edu/webdata/dataset/$seq/hdHand3d.tar" \
| tar -C "data/panoptic/$seq" -xf - \
|| true
wget --tries=2 --timeout=60 -O - \
"http://domedb.perception.cs.cmu.edu/webdata/dataset/$seq/hdMeshTrack_face.tar" \
| tar -C "data/panoptic/$seq" -xf - \
|| true
wget -c --tries=2 --timeout=60 \
-O "data/panoptic/$seq/calibration_$seq.json" \
"http://domedb.perception.cs.cmu.edu/webdata/dataset/$seq/calibration_$seq.json" \
|| rm -f "data/panoptic/$seq/calibration_$seq.json"
for i in $(seq -w 0 30); do
wget -c --tries=2 --timeout=60 \
-O "data/panoptic/$seq/videos/hd_shared_crf20/hd_00_$i.mp4" \
"http://domedb.perception.cs.cmu.edu/webdata/dataset/$seq/videos/hd_shared_crf20/hd_00_$i.mp4" \
|| rm -f "data/panoptic/$seq/videos/hd_shared_crf20/hd_00_$i.mp4"
done
done <<'EOF'
171204_pose1
171204_pose2
171026_pose1
171026_pose2
171026_pose3
170221_haggling_b1
170221_haggling_b2
170221_haggling_b3
170221_haggling_m1
170221_haggling_m2
170221_haggling_m3
170224_haggling_a2
170224_haggling_a3
170224_haggling_b1
170224_haggling_b2
170224_haggling_b3
170228_haggling_a1
170228_haggling_a2
170228_haggling_a3
170228_haggling_b1
170228_haggling_b2
170228_haggling_b3
170404_haggling_a1
170404_haggling_a2
170404_haggling_a3
170404_haggling_b1
170404_haggling_b2
170404_haggling_b3
170407_haggling_a1
170407_haggling_a2
170407_haggling_a3
170407_haggling_b1
170407_haggling_b2
170407_haggling_b3
171026_cello3
161029_flute1
161029_piano1
161029_piano2
161029_piano3
161029_piano4
160906_band1
160906_band2
160906_band3
160422_ultimatum1
160226_haggling1
170307_dance5
160906_ian5
160906_ian3
160906_ian2
160906_ian1
170915_office1
170407_office2
160906_pizza1
EOF
Command-Line Usage
List Registered Point Trackers
Verify that track_4dgs can import and register trackers:
python -c "import track_4dgs; print(track_4dgs.get_available_point_trackers())"
| Name | Class | Kind | track1v |
|---|---|---|---|
cotracker3 |
Cotracker3PointTracker |
single-view | yes |
vggt |
VGGTPointTracker |
single-view | yes |
vggsfm |
VGGSfMPointTracker |
single-view | yes |
d4rt |
D4RTPointTracker |
single-view | yes |
mvroma |
MVRoMaPointTracker |
single-view | yes |
uniflowmatch |
UniFlowMatchPointTracker |
single-view | yes |
raft |
RAFTPointTracker |
single-view | yes |
dot |
DOTPointTracker |
single-view | yes |
mvtap |
MVTAPPointTracker |
joint multi-view | no |
blender |
BlenderPointTracker |
joint mesh | no |
track1v accepts an AbstractViewPointTracker. Joint trackers run through build_dataset. blender is documented in Blender mesh tracking.
Track One Image Sequence
python -m track_4dgs.track1v \
-s data/frame_000.png data/frame_001.png data/frame_002.png \
-d output/track1v-cotracker3 \
--tracker cotracker3 \
--num-points 256
The command samples random query points on the first image, tracks them through all source images, and saves a rendered track overlay sequence under the destination directory. Overlay color follows confidence: red is low, green is high.
Tracker-specific options can be passed with repeated -m/--option_tracker values. Trackers that chunk query points take that size as a constructor batch_size. Omit it to track every point in one call.
python -m track_4dgs.track1v \
-s data/frame_000.png data/frame_001.png data/frame_002.png \
-d output/track1v-vggt \
--tracker vggt \
-m checkpoint="'checkpoints/vggt_1B_commercial.pt'" \
-m batch_size=128 \
-m iters=4
Build a Supervision Dataset
python -m track_4dgs.build_dataset runs a registered supervision dataset. --save-folder and --vis-folder are both optional, and at least one is required. With --save-folder, it writes one folder per sample:
<save-folder>/supervision<index>/
query.pt
frame1/ ... # COLMAP images and sparse/0
0.pt 1.pt ... # one Track per view
--save-start is the first index and defaults to 1, so the first saved sample is supervision1. --vis-folder writes rainbow overlays. If --save-folder is set, the overlays are drawn from the saved samples. If it is omitted, build_dataset draws the in-memory dataset directly and does not write it to disk. Omit --vis-folder to save without overlays.
List the dataset names:
python -c "import track_4dgs; print(track_4dgs.get_available_supervision_datasets())"
tracker: sample points uniformly inside the scene cube, keep those seen by more cameras than--visible-cameras(default 2), project them, and trackgstracker: sample a random subset of a trained 3DGS point cloud, then track those pointsblender: render a.blendfile from sampled cameras and track the query on its evaluated meshes. See Blender mesh trackingharmony4d: project the checked COCO joints, then sample the rest on the posed SMPL meshes. About 20 exo cameras per sequencepanoptic: project the 19 body joints of each person, then sample the rest on a ribbon beside those bones. 31 HD cameras per sequence
Harmony4D and Panoptic both record many more cameras than a typical capture, so a sample that keeps every view is large. Both take --view-indices on the preceding --sequence. The integers index the cameras after sorting — Harmony4D by exo folder name, Panoptic by HD camera name — and that order is the view order. Leave the flag unset to keep every camera. Indices are unique and lie in 0 .. V - 1.
python -m track_4dgs.build_dataset \
--dataset harmony4d \
--sequence data/harmony4d/train/01_hugging \
--view-indices 0 3 1 \
--num-points 256 \
--save-folder output/harmony4d/01_hugging
python -m track_4dgs.build_dataset \
--dataset panoptic \
--sequence data/panoptic/171204_pose1 \
--view-indices 0 5 10 \
--num-points 256 \
--save-folder output/panoptic/171204_pose1
Uniform scene points:
python -m track_4dgs.build_dataset \
--dataset tracker \
--tracker cotracker3 \
-s data/sequence/frame_000 data/sequence/frame_001 data/sequence/frame_002 \
--num-points 256 \
--visible-cameras 2 \
--save-folder output/sequence/dataset-cotracker3 \
--vis-folder output/sequence/dataset-cotracker3-vis
Gaussian point cloud. -d and -i name the run whose checkpoint is sampled:
<destination>/point_cloud/iteration_<iteration>/point_cloud.ply
python -m track_4dgs.build_dataset \
--dataset gstracker \
--tracker mvtap \
-s data/sequence/frame_000 data/sequence/frame_001 data/sequence/frame_002 \
-d output/sequence \
-i 30000 \
--num-points 256 \
-m batch_size=32 \
--save-folder output/sequence/dataset-mvtap \
--vis-folder output/sequence/dataset-mvtap-vis
Repeat -s/--sources to add another sample. --load_cameras and --init-dataset-index attach to the preceding --sources and may each appear once in that group. --init-dataset-index defaults to 0. For gstracker, -d/--destination and -i/--iteration likewise attach to that group.
Blender Mesh Tracking
track_4dgs.blender (--tracker blender) binds query pixels to evaluated meshes in a .blend file and carries each hit with that triangle's barycentric coordinates.
Armature deformation, shape keys, and other modifiers are included when the mesh topology stays fixed.
Use it together with the Blender tools in NVS2COLMAP.
NVS2COLMAP renders that blend file into a Neural 3D Video scene (poses_bounds.npy and one video per camera), then nvs2colmap.n3dv writes one COLMAP camera dataset per frame. This tracker reads the same .blend file and those frame datasets. Cameras stay in the blend world, look along +Z, and treat image +Y as downward, which is the OpenCV camera NVS2COLMAP stores in poses_bounds.npy. Dataset frame i in --sources is the i-th frame selected from the blend. Index 0 is the scene's first frame, which Blender often numbers 1, so on that scene index i is Blender frame 1 + i. --frames is a Python expression of n, the number of frames from the scene's first through its last, and returns a tuple[int] of those indices. The default tuple(range(n)) keeps every frame. Pass another expression with -m frames="'tuple(range(0, n, 2))'". Install NVS2COLMAP and keep a Blender executable on PATH as blender, or pass another path with -m blender="'path/to/blender'". warp-lang is already installed with this package.
nvs2colmap-sample-cameras can place the cameras and write poses_bounds.npy. Render the blend file from those cameras:
python -m nvs2colmap.blender \
--path data/scene \
--blend data/scene.blend
Decode the rendered videos into per-frame COLMAP datasets:
python -m nvs2colmap.n3dv \
--path data/scene \
--ffmpeg ffmpeg \
--ffprobe ffprobe
Track those frames with the same blend file. This only writes overlays:
python -m track_4dgs.build_dataset \
--dataset gstracker \
--tracker blender \
-s data/scene/frame1 data/scene/frame2 data/scene/frame3 \
-d output/scene \
-i 30000 \
-m blend="'data/scene.blend'" \
--vis-folder output/scene/track-blender-vis
nvs2colmap.blender still takes absolute Blender frames. On a scene whose first frame is Blender frame 1, --frame_start 10 --frame_end 14 --frame_step 2 is indices 9, 11, and 13: tuple(range(9, 14, 2)). nvs2colmap.blender --frame_step already drops frames inside each camera video, and nvs2colmap.n3dv still writes consecutive frame* folders. Leave nvs2colmap.n3dv --start-number at its default of 1: that flag counts frames inside the rendered video, so frame1 is the first frame the Blender render wrote. --sources then lists frame1, frame2, ... in the expression's order.
python -m nvs2colmap.blender \
--path data/scene \
--blend data/scene.blend \
--frame_start 10 \
--frame_end 14 \
--frame_step 2
python -m track_4dgs.build_dataset \
--dataset gstracker \
--tracker blender \
-s data/scene/frame1 data/scene/frame2 data/scene/frame3 \
-d output/scene \
-i 30000 \
-m blend="'data/scene.blend'" \
-m frames="'tuple(range(9, 14, 2))'" \
--vis-folder output/scene/track-blender-vis
build_dataset --dataset blender can skip the COLMAP export and render supervision directly. It samples OpenCV cameras on a spherical cap, samples the query near the mesh at --init-dataset-index, renders every view, and binds the tracks to the evaluated meshes. --frames and --init-dataset-index attach to the preceding --blend. Index 0 is the scene's first frame. --frames defaults to tuple(range(n)). Repeat --blend for another sample.
python -m track_4dgs.build_dataset \
--dataset blender \
--blend data/scene.blend \
--n-cameras 8 \
--height 512 \
--width 512 \
--focal 500 \
--num-points 256 \
--save-folder output/scene/dataset-blender \
--vis-folder output/scene/dataset-blender-vis
API Usage
Build a Tracker
from track_4dgs.registry import build_point_tracker, get_available_point_trackers
print(get_available_point_trackers())
tracker = build_point_tracker(
"cotracker3",
checkpoint="checkpoints/scaled_offline.pth",
).to("cuda")
Track Image Tensors
sample_query returns pixel coordinates and a frame index of 0 for every point. track_view is the single-view entry used by track1v.
import torch
from track_4dgs.track1v import load_image, sample_query
frames = [
load_image("data/frame_000.png", "cuda"),
load_image("data/frame_001.png", "cuda"),
]
points, frame_indices = sample_query(frames[0], num_points=256)
with torch.no_grad():
track = tracker.track_view(
points,
frame_indices,
frames,
[None] * len(frames),
)
print(track.points.shape) # [num_frames, num_points, 2]
print(track.visibility.shape) # [num_frames, num_points]
print(track.confidence.shape) # [num_frames, num_points]
Track Gaussian Splatting Camera Datasets
build_camera_dataset_tracker and CameraDatasetTracker are reserved. They attach each view's track onto the cameras as camera.custom_data["track"]. build_dataset does not call them; it keeps the view-major Supervision tracks.
from gaussian_splatting.prepare import prepare_gaussians
from track_4dgs.dataset import build_camera_dataset_tracker, prepare_datasets, query_views_from_gaussians
sources = [
"data/sequence/frame_000",
"data/sequence/frame_001",
]
datasets = prepare_datasets(
sources=sources,
device="cuda",
cache_size=2 ** 16,
reorder_reference_idx=0,
)
gaussians = prepare_gaussians(
sh_degree=3,
source=sources[0],
device="cuda",
load_ply="output/sequence/point_cloud/iteration_30000/point_cloud.ply",
)
dataset_tracker = build_camera_dataset_tracker(
tracker_name="cotracker3",
device="cuda",
tracker_configs={"checkpoint": "checkpoints/scaled_offline.pth"},
)
queries = query_views_from_gaussians(
datasets=datasets,
gaussians=gaussians,
init_dataset_index=0,
num_points=256,
)
tracked_datasets = dataset_tracker(queries, datasets)
camera_track = tracked_datasets[0][0].custom_data["track"]
print(camera_track.points.shape) # [num_points, 2] for this camera in this frame
Load Saved Supervision
from track_4dgs import SavedDataset
dataset = SavedDataset("output/sequence/dataset-mvtap", start=1)
sample = dataset[0]
print(sample.query.points.shape) # [num_views, num_points, 2]
print(len(sample.frames)) # num_frames
print(sample.tracks[0].points.shape) # [num_frames, num_points, 2]
frame = sample.tracked_camera_dataset(0)
camera_track = frame[0].custom_data["track"]
print(camera_track.points.shape) # [num_points, 2] for this camera in this frame
Supervision holds a view-major Query, one camera dataset per frame, and one Track per view. AbstractDataset.dump writes that layout; SavedDataset reads it back. tracked_camera_dataset(index) returns that frame as a TrackedCameraDataset: each camera's custom_data["track"] is the CameraTrack sliced from the matching view track. This does not run a tracker; the tracks are already stored on the sample.
Design: Point Tracker Registry
AbstractPointTracker.__call__ validates inputs, then calls track. It takes a view-major Query (points [V, N, 2], frame_indices [V, N], in_image [V, N]) and frame-major camera datasets, and returns one Track per view. A tracker that chunks query points reads batch_size from its constructor. build_dataset keeps that view-major Supervision layout.
CameraDatasetTracker and build_camera_dataset_tracker are reserved for a later step that hangs those tracks back on the cameras. build_camera_dataset_tracker(tracker_name, device, tracker_configs) builds a registered point tracker and wraps it. Calling the wrapper with a view-major Query and frame-major camera datasets returns one TrackedCameraDataset per frame. Each camera then carries its CameraTrack on camera.custom_data["track"]. A saved sample can rebuild one frame of that layout with Supervision.tracked_camera_dataset(index) without running the tracker again. build_dataset does not call this path:
query + frames -> validate + track -> view_tracks -> tracked camera datasets
Single-view trackers (AbstractViewPointTracker, e.g. CoTracker3 / VGGT / DOT) split the query by view and implement track_view(points, frame_indices, frames) for one camera sequence. MV-TAP and Blender subclass AbstractPointTracker and implement track(query, frames) for all views at once. MV-TAP splits query points with its constructor batch_size when it is set.
Frame 0 cameras --\
Frame 1 cameras ----> single-view loop, or one joint multi-view call ----> view_tracks
Frame 2 cameras --/
in_image marks query pixels that project inside the frame (and in front of the camera, when the query comes from Query.from_projection). Single-view trackers skip points that fail this test. Joint trackers fold it into Track.mask.
This keeps model-specific code isolated in tracker implementations while the 4DGS workflow can use any registered tracker by name.
Extending: Adding a New Point Tracker
Single-view trackers return Track(points=[D, N, 2], visibility=[D, N], confidence=[D, N], mask=[D, N]) from track_view:
from collections.abc import Sequence
import torch
from track_4dgs.tracker import AbstractViewPointTracker, Track
class MyPointTracker(AbstractViewPointTracker):
def to(self, device):
self.device = torch.device(device)
return self
def track_view(
self,
points: torch.Tensor,
frame_indices: torch.Tensor,
frames: Sequence[torch.Tensor],
) -> Track:
...
A multi-view tracker subclasses AbstractPointTracker and implements track(self, query, frames) -> Sequence[Track], one Track per view. Fold in_image into Track.mask.
Register it at import time:
from track_4dgs.registry import register_point_tracker
register_point_tracker("mytracker", MyPointTracker)
After registration, it is available everywhere a single-view tracker is accepted:
python -m track_4dgs.track1v --tracker mytracker -s frame0.png frame1.png -d output/mytracker
Import the module that calls register_point_tracker before build_point_tracker. The built-in trackers register themselves from track_4dgs/__init__.py.
Acknowledgement
This repo is developed based on CoTracker, VGGT, MV-TAP, OpenD4RT, MV-RoMa, UniFlowMatch, torchvision RAFT, UniCeption, LightGlue, gaussian-splatting (packaged), and NVS2COLMAP. Many thanks to the authors for open-sourcing their codebases.
Metadata
Release files for track-4dgs 1.12.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| track_4dgs-1.12.8.tar.gz | 390.1 kB | With provenance | Details for track_4dgs-1.12.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| track_4dgs-1.12.8-py3-none-any.whl | Python 3 | none | any | Details for track_4dgs-1.12.8-py3-none-any.whl |
Total release size: 874.7 kB
Release files / track_4dgs-1.12.8.tar.gz
| Download URL | track_4dgs-1.12.8.tar.gz |
|---|---|
| Size | 390.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f824a04a8a71da5a2d5e259bfee0bc2d2f6c22fc56857fca4bf8723ca5479672
|
|
BLAKE2b-256 checksum How to use checksums |
16a5799ba146c5fb67d735fbf6e49182c89e257bf22d336986abf4b3fe253c48
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.
Transparency logRelease files / track_4dgs-1.12.8-py3-none-any.whl
| Download URL | track_4dgs-1.12.8-py3-none-any.whl |
|---|---|
| Size | 484.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3e3f410770fb95c2dabec863cf8ead3d57aad96ee118b175d451bee34f6b4673
|
|
BLAKE2b-256 checksum How to use checksums |
5665cd5baa12f86977ebfc85158aa0453954c0199a70839952b31382f7966abb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.
Transparency logSecurity for track-4dgs 1.12.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for track_4dgs-1.12.8.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.