V-JEPA 2.1 ViT-G (
vjepa2_1_vit_giant_384) を映像特徴抽出のバックボーンとして使用しています。V-JEPA は Meta が開発した自己教師あり映像表現学習モデルで、時空間トークンを出力します。
本モデル(Event Decoder 部分)は V-JEPA の出力トークンを入力とし、Object Pooling と Event Decoder の 2 段階でイベントグラフを予測します。V-JEPA 自体の重みは本チェックポイントに含まれません(別途 PyTorch Hub からロードされます)。
Video → V-JEPA 2.1 ViT-G → spatiotemporal tokens (B, S, 1408)
→ ObjectPoolingModule (Slot Attention, K=24 slots)
→ ObjectRepresentation (identity, trajectory, existence, categories)
→ VJEPAEventDecoder (M=20 event queries, cross-attention)
→ 7 Prediction Heads → EventGraph JSON
1# リポジトリをクローン
2git clone https://github.com/ChanYu1224/event-graph-generation.git
3cd event-graph-generation
4uv sync
5
6# 推論実行
7uv run python scripts/6_run_inference.py \
8 --video your_video.mp4 \
9 --checkpoint path/to/model.pt \
10 --config configs/vjepa_training.yaml \
11 --vjepa-config configs/vjepa.yaml \
12 --output output/event_graph.json
1import torch
2from huggingface_hub import hf_hub_download
3
4# Download model
5model_path = hf_hub_download(repo_id="Yuchn/event-graph-vitg", filename="model.pt")
6config_path = hf_hub_download(repo_id="Yuchn/event-graph-vitg", filename="config.yaml")
7
8# Build model
9from event_graph_generation.config import Config
10from event_graph_generation.models.base import build_model
11
12config = Config.from_yaml(config_path)
13model = build_model(config.model, vjepa_config=config.vjepa)
14
15state_dict = torch.load(model_path, map_location="cpu")
16model.load_state_dict(state_dict)
17model.eval()
18
19# Forward pass (vjepa_tokens: pre-extracted V-JEPA features)
20# vjepa_tokens shape: (batch_size, num_tokens, hidden_size)
21with torch.no_grad():
22 obj_repr, predictions = model(vjepa_tokens)
1@software{event_graph_generation_2026,
2 title = {Event Graph Generation: Structured Event Prediction from Video},
3 author = {Yuchn},
4 year = {2026},
5 url = {https://github.com/ChanYu1224/event-graph-generation},
6 license = {MIT}
7}