Instructions to use AlterraLaniakea/jepa-guided-diffusion with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Cosmos
How to use AlterraLaniakea/jepa-guided-diffusion with Cosmos:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
VL-JEPA β Cosmos context predictor (jepa-guided-diffusion)
VL-JEPA is a lightweight predictor bridge that maps a WTS traffic video (plus a text
query) into the frozen Cosmos-Reason1 (512, 1024) context space, so the predicted
embedding can condition Cosmos-Predict2.5 video generation without running the 7B
Reason1 text encoder at inference time.
- Input: video / frame directory + a WTS-format query.
- Output: a
(512, 1024)context tensor (the Cosmos cross-attention conditioning set). - Objective: permutation-invariant set-match Hungarian MSE β Cosmos consumes the context as an unordered set, so the predicted 512 tokens are matched to the target 512 tokens (Hungarian assignment) before MSE.
Architecture
| Part | Role | Source |
|---|---|---|
| X-Encoder (frozen) | VJEPA 2.1 ViT-L/384 (vjepa2_1_vit_large_384), video mode β visual tokens |
torch.hub (facebookresearch/vjepa2) |
| Compressor (trained) | BLIP-2-style QFormer: 512 query tokens, 4 layers, cross-attn every layer | in model.pt |
| Backbone (trained) | last 4 layers of Llama-3.2-1B, made bidirectional | arch from hub, weights in model.pt |
| Head (trained) | output_projection β (512, 1024) |
in model.pt |
| Y-Encoder (frozen, target only) | Cosmos-Reason1-7B full_concat + crossattn_proj |
not needed at inference |
Only the compressor, the last 4 Llama layers, the vision projection, and the output projection are trained; VJEPA2 and Reason1 are frozen.
Repo layout
config.yaml # full model/eval config the loader reads
best_model/model.pt # trained weights (predictor only)
best_model/model_config.yaml # model config sidecar
best_model/query_tokenizer/ # Llama query tokenizer
Usage
Install the VL-JEPA package (uv-managed), then pass
this repo id as --checkpoint β it is downloaded and cached automatically:
# whole test set: writes <scenario>/embedding.pt for the Cosmos handoff
uv run vl-jepa seq-infer --checkpoint AlterraLaniakea/jepa-guided-diffusion --test-root wts/test
# single scenario -> print the (512,1024) embedding
uv run vl-jepa infer \
--checkpoint AlterraLaniakea/jepa-guided-diffusion \
--visual-path wts/test/<scenario>/input \
--output embedding \
--query "The current preset is from overhead view with 2 target subjects. Pedestrian: A man in his 30s stands on the road facing the oncoming vehicle. Vehicle: The vehicle goes straight at a constant speed."
Query format. For in-distribution embeddings, use the same query format as training
(seq-infer builds this automatically from caption.json):
The current preset is from <overhead|vehicle> view with <N> target subject(s). Pedestrian: <ped caption> Vehicle: <veh caption>
<overhead|vehicle>βoverheadfor CCTV,vehiclefor dashcam (video*) clips.<N>β subject types present:1(pedestrian or vehicle) or2(both).
Requirements
- Gated Llama-3.2-1B: run
hf auth login(or exportHF_TOKEN) before first use β the loader rebuilds the Llama backbone architecture from the hub and overlays the trained weights. (Sethf_token: trueinconfig.yaml, or provide the token via env.) - VJEPA2 is fetched from
facebookresearch/vjepa2(torch.hub / GitHub source). - A GPU is recommended; VJEPA2 runs at crop size 384.
Downstream
Feed the predicted embedding.pt into Cosmos-Predict2.5 via scripts/generate_cosmos.py
(see the repo README) to generate the WTS video for each scenario.
- Downloads last month
- 107
Model tree for AlterraLaniakea/jepa-guided-diffusion
Base model
meta-llama/Llama-3.2-1B