[来源关键摘录] Official PyTorch code and model weights for V-JEPA 2 self-supervised video learning and action-conditioned world modeling.
[正文前段节选] Skip to content
Navigation Menu
Appearance settings
You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.
You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
{{ message }}
Repository navigation
NotificationsYou must be signed in to change notification settings
Fork599 (599)
Star4.9k (4.9k)You must be signed in to star a repository
PyTorch code and models for VJEPA2 self-supervised learning from video.
MIT, Apache-2.0 licenses found
Code of conduct
Contributing
Security policy
Custom properties
Report repository
BranchesTags
Open more actions menu
Latest commit
Folders and files
Last commit message
Last commit date
.github/workflows
APACHE-LICENSE
CHANGELOG.md
CODE_OF_CONDUCT.md
CONTRIBUTING.md
pyproject.toml
requirements-test.txt
requirements.txt
View all files
Repository files navigation
🆕 [2026-03-16]: 🔥 V-JEPA 2.1 is released 🔥 A new familly of models trained with a novel recipe that learns high quality and temporolly consistent dense features !!!
[2025-06-25]: V-JEPA 2 is released. [Blog]
V-JEPA 2: Self-Supervised Video Models Enable Understanding, Prediction and Planning
Mahmoud Assran∗, Adrien Bardes∗, David Fan∗, Quentin Garrido∗, Russell Howes∗, Mojtaba
Komeili∗, Matthew Muckley∗, Ammar Rizvi∗, Claire Roberts∗, Koustuv Sinha∗, Artem Zholus*,
Sergio Arnaud*, Abha Gejji*, Ada Martin*, Francois Robert Hogan*, Daniel Dugas*, Piotr
Bojanowski, Vasil Khalidov, Patrick Labatut, Francisco Massa, Marc Szafraniec, Kapil
Krishnakumar, Yong Li, Xiaodong Ma, Sarath Chandar, Franziska Meier*, Yann LeCun*, Michael
Rabbat*, Nicolas Ballas*
[Paper] [Blog] [BibTex]
Official Pytorch codebase for V-JEPA 2, V-JEPA 2-AC, V-JEPA 2.1.
V-JEPA 2 is a self-supervised approach to training video encoders, using internet-scale video data, that attains state-of-the-art performance on motion understanding and human action anticipation tasks. V-JEPA 2-AC is a latent action-conditioned world model post-trained from V-JEPA 2 (using a small amount of robot trajectory interaction data) that solves robot manipulation tasks without environment-specific data collection or task-specific training or calibration.
V-JEPA 2.1 Pre-training
Lorenzo Mur-Labadia, Matthew Muckley, Amir Bar, Mahmoud Assran, Koustuv Sinha, Michael
Rabbat, Yann LeCun, Nicolas Ballas, Adrien Bardes
[Paper] [BibTex]
V-JEPA 2.1 improves the training recipe to focus on learning high-quality and temporally consistent dense features, as higlighted by PCA visualizations:
The V-JEPA 2.1 approach leverages: (1) Dense Predictive Loss, a masking-based
self-supervision objective where all tokens (both visible/context and masked tokens) contribute to the
self-supervised training loss; (2) Deep Self-Supervision, which applies the self-supervised loss at multiple
intermediate representations of the encoder models; (3) Multi-Modal Tokenizers for images and videos;
and we show that our approach benefit from (4) Model and data scaling.
V-JEPA 2.1 performance across dense and global prediction tasks:
V-JEPA 2 Pre-training
(Top) The encoder and predictor are pre-trained through self-supervised learning from video using a masked latent feature prediction objective, leveraging abundant natural videos to bootstrap physical world understanding and prediction. (Bottom) Performance of V-JEPA 2 on downstream understanding and prediction tasks.
Previous Best
27.6% (PlausiVL)
SSv2 (Probe)
69.7% (InternVideo2-1B)
Diving48 (Probe)
86.4% (InternVideo2-1B)
MVP (Video QA)
39.9% (InternVL-2.5)
TempCompass (Video QA)
75.3% (Tarsier 2)
V-JEPA 2-AC Post-training
(Top) After post-training with a small amount of robot data, we can deploy the model on a robot arm in new environments, and tackle foundational tasks like reaching, grasping, and pick-and-place by planning from image goals. (Bottom) Performance on robot manipulation tasks using a Franka arm, with input provided through a monocular RGB camera.
Pick-and-Place
V-JEPA 2 and V-JEPA 2.1
See our HuggingFace collection for V-JEPA 2.
V-JEPA 2 Pretrained Checkpoints
Download Link
Pretraining Config
V-JEPA 2.1 Pretrained Checkpoints
Pretrained backbones (via PyTorch Hub)
Please install Pytorch, timm and einops locally, then run the following to load each model. Installing Pytorch with CUDA support is strongly recommended.
import torch
# preprocessor
processor = torch.hub.load('facebookresearch/vjepa2', 'vjepa2_preprocessor')
vjepa2_vit_large = torch.hub.load('facebookresearch/vjepa2', 'vjepa2_vit_large')
vjepa2_vit_huge = torch.hub.load('facebookresearch/vjepa2', 'vjepa2_vit_huge')
vjepa2_vit_giant = torch.hub.load('facebookresearch/vjepa2', 'vjepa2_vit_giant')
vjepa2_vit_giant_384 = torch.hub.load('facebookresearch/vjepa2', 'vjepa2_vit_giant_384')
# V-JEPA 2.1
vjepa2_1_vit_base_384 = torch.hub.load('facebookresearch/vjepa2', 'vjepa2_1_vit_base_384')
vjepa2_1_vit_large_384 = torch.hub.load('facebookresearch/vjepa2', 'vjepa2_1_vit_large_384')
vjepa2_1_vit_giant_384 = torch.hub.load('facebookresearch/vjepa2', 'vjepa2_1_vit_giant_384')
vjepa2_1_vit_gigantic_384 = torch.hub.load('facebookresearch/vjepa2', 'vjepa2_1_vit_gigantic_384')
Pretrained checkpoints on Huggingface
You can also use our pretrained checkpoints on Huggingface for V-JEPA 2.
from transformers import AutoVideoProcessor, AutoModel
hf_repo = "facebook/vjepa2-vitg-fpc64-256"
# facebook/vjepa2-vitl-fpc64-256
# facebook/vjepa2-vith-fpc64-256
# facebook/vjepa2-vitg-fpc64-256
# facebook/vjepa2-vitg-fpc64-384
model = AutoModel.from_pretrained(hf_repo)
processor = AutoVideoProcessor.from_pretrained(hf_repo)
Evaluation Attentive Probes
We share the trained attentive probes for two of our visual understanding evals (Something-Something v2 and Diving48) and the action anticipation eval EPIC-KITCHENS-100.
Training Config
Inference Config
Our action-conditioned checkpoint was trained from the ViT-g encoder.
Pretrained action-conditioned backbone (via PyTorch Hub)
vjepa2_encoder, vjepa2_ac_predictor = torch.hub.load('facebookresearch/vjepa2', 'vjepa2_ac_vit_giant')
See energy_landscape_example.ipynb for an example notebook computing the energy landscape of the pretrained action-conditioned backbone using a robot trajectory collected from our lab.
To run this notebook, you'll need to additionally install Jupyter and Scipy in your conda environment.
Getting Started
conda create -n vjepa2-312 python=3.12
conda activate vjepa2-312
pip install . # or `pip install -e .` for development mode
Note to macOS users: V-JEPA 2 relies on decord, which does not support macOS (and, unfortunately, is also no longer under development). In order to run the V-JEPA 2 code on macOS, you will need a different decord implementation. We do not make specific recommendations, although some users have reported the use of eva-decord (see PR 1) or decord2 (see PR 31). We leave the selection of the decord package up to the user's discretion.
See vjepa2_demo.ipynb (Colab Link) or vjepa2_demo.py for an example of how to load both the HuggingFace and PyTorch V-JEPA 2 models and run inference on a sample video to get a sample classification result.
The script assumes the presence of downloaded model checkpoints so you will need to download the model weights and update the corresponding paths in the script. E.g.:
wget https://dl.fbaipublicfiles.com/vjepa2/vitg-384.pt -P YOUR_DIR
wget https://dl.fbaipublicfiles.com/vjepa2/evals/ssv2-vitg-384-64x2x3.pt -P YOUR_DIR
# Then update your model paths in vjepa2_demo.py.
pt_model_path = YOUR_DIR/vitg-384.pt
classifier_model_path = YOUR_DIR/ssv2-vitg-384-64x2x3.pt
# Then run the script (assumes your machine has a GPU)
python -m notebooks.vjepa2_demo
Probe-based evaluation
[...内容已截断,完整版请查看原文或 Wayback 快照]