MTR-JEPA β€” nuScenes

Release package for unionpan/MTR_mtr-jepa-nuscenes. The learned MTR weights are licensed under CC BY-NC-SA 4.0 (LICENSE-WEIGHTS); source code remains MIT (LICENSE-CODE). The license covers only rights held by the author; it does not grant rights to third-party backbones or nuScenes data.

MTR temporal model and forecasting heads trained on nuScenes using a frozen V-JEPA 2.1 ViT-B/16 video encoder. This is an independent research adaptation, not an official Meta model. It is not a driving controller or a safety-validated system. The release contains learned MTR tensors only, not the video encoder, DistilBERT, tokenizer, dataset, cached features, optimizer or RNG states.

Checkpoint and results

The default is vjepa21_s42/best_motion.pt, epoch 20 (one-based). Seed 42 was chosen as the median validation-ADE seed among 42/43/44, not the best seed. Checkpoints within each run were selected using validation ADE; all following numbers are validation-selected, not untouched-test results.

Result ADE (m, lower better) FDE (m, lower better)
This exported checkpoint 1.020155 2.247754
V-JEPA three-seed mean Β± seed SD 1.018739 Β± 0.002724 2.243065 Β± 0.005747
Matched front DINOv2 control, three-seed mean 1.061584 2.293466
Kinematics-only polynomial ridge, train-scene-CV selected 0.963377 2.117623

V-JEPA minus front control ADE: -0.042845 m, paired seed/scene bootstrap 95% interval [-0.066361, -0.020539]. The stronger kinematics-only control still has lower forecasting error.

Training: official 700/150 nuScenes train/validation scene split, 12,522/2,682 clips, 2,232 motion-valid validation clips, 20 epochs, batch 128, seeds 42/43/44. Training used CUDA with fp16 AMP. CPU below is just the portable inference default; the model is not CPU-only. See metrics.json, training_config.json, and experiment_results.md. The three-seed observed-motion linear-probe accuracy is 0.9756; that is a separately fitted logistic-regression probe, not a classifier bundled in these weights. Retrieval used separately selected retrieval checkpoints; headline retrieval numbers from that study do not describe this motion-selected checkpoint.

Local feature-based inference (CPU default, no downloads)

Download the repository with hf download unionpan/MTR_mtr-jepa-nuscenes --local-dir mtr-jepa, then cd mtr-jepa. Install torch/torchvision compatible with your platform, then:

pip install -r requirements.txt
python smoke_test.py
python inference.py --model-dir . --features observed_features.npz --output forecast.npz

The NPZ must contain:

  • features: float32 [B,3,1,768], from the pinned V-JEPA encoder on six observed CAM_FRONT images in chronological order, nominally 2 Hz over 2.5 s. These are spatially averaged tubelet tokens, not arbitrary DINO/image vectors.
  • ego_poses: [B,6,3], observed world x/y in metres and yaw in radians.
  • timestamps: float64 [B,6], matching observed times in seconds (not nuScenes microseconds). Do not round absolute UNIX seconds to float32.

No future poses, future images, targets or captions are inference inputs. The output waypoints is [B,6,2] for 0.5, 1.0, ..., 3.0 s in the final observed ego frame: x forward, y left, metres. clip_embedding is [B,512]; video_embedding is L2-normalized [B,256]. Text retrieval additionally needs the matching frozen DistilBERT text features; it is not a zero-shot VLM API.

import numpy as np
from mtr.release import load_release, predict_observed

model = load_release('.', device='cpu')
with np.load('observed_features.npz', allow_pickle=False) as data:
    result = predict_observed(model, data['features'], data['ego_poses'], data['timestamps'])
print(result['waypoints'].shape)

For CUDA inference, use load_release('.', device='cuda') or:

python inference.py --device cuda --features observed_features.npz --output forecast-gpu.npz

Optional raw-image feature extraction

observations.json must contain frames (six image paths, relative to the JSON), ego_poses (six [x,y,yaw] observations), and timestamps (six seconds). Use your own appropriately licensed images; none are bundled.

python encode_video.py --observations observations.json --output observed_features.npz \
  --allow-backbone-download

The flag explicitly opts into executing pinned upstream Torch Hub code and downloading the official encoder checkpoint (~1.66 GB). Without it the script requires the pinned source/weights in the local Torch Hub cache; optionally provide --backbone-checkpoint /path/to/checkpoint.pt. SHA256 is checked before loading the upstream checkpoint. Backbone source revision and weight hash are in manifest.json; upstream licenses/notices remain applicable.

Preprocessing: short-side resize to 438 (bilinear), center crop 384, ImageNet normalization. Six real observed frames produce 1,728 video tokens, pooled spatially into three tubelets. Training caches used CUDA fp16 autocast and float16 storage. CPU extraction defaults to fp32 and is not bit-identical to the GPU extraction; use the original cache for exact numerical reproduction.

Limitations and licensing

  • Frozen video features process the whole observed clip before output-token masking. This is not equivalent to re-encoding masked raw frames.
  • Native context/token count/preprocessing differ from the DINOv2 front control; this study does not isolate encoder architecture alone.
  • The head retains per-clip LayerNorm on mixed kinematic quantities, which can obscure absolute speed; no claim of optimal kinematics fusion is made.
  • Captions are structured/observed metadata, not human free-form descriptions.
  • This is a small, validation-selected empirical study, not a SOTA claim.
  • Code: MIT (LICENSE-CODE). Learned weights: CC BY-NC-SA 4.0 (LICENSE-WEIGHTS): attribution, noncommercial use and share-alike for adaptations. This does not override upstream or dataset terms.
  • Do not redistribute nuScenes images/annotations/features via this package.
  • Cite nuScenes and V-JEPA 2.1 and preserve the upstream notices when applicable.

Source: https://github.com/UnionPan/mtr-nuscenes V-JEPA: https://github.com/facebookresearch/vjepa2/tree/204698b45b3712590f06245fbfba32d3be539812 nuScenes terms: https://www.nuscenes.org/terms-of-use

manifest.json records payload hashes, source hashes and checkpoint provenance. Checksums detect accidental modification; they are not cryptographic signatures.

Downloads last month
18
Safetensors
Model size
15.8M params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support