Download code/README.md from MRBSTUDIO/AGT: direct link, hf CLI and curl.
- Browser
- Download file 10.8 kB
-
https://huggingface.co/MRBSTUDIO/AGT/resolve/main/code/README.md
- Command line
-
hf download hf://MRBSTUDIO/AGT/code/README.md
-
curl -L -o README.md https://huggingface.co/MRBSTUDIO/AGT/resolve/main/code/README.md
AGT: Amodal 4D Reconstruction from Obstructed Driving Videos
Bodong Bi1*, Nuo Chen2*, Hongyu Xu3, Xiaoqiang Kong2, Baoru Huang4, Anh Nguyen4, Yang Zhou2, Zhiwen Fan2β
1University of Michigan 2Texas A&M University 3General Motors 4University of Liverpool
*Equal contribution β Corresponding author
Overview
AGT reconstructs a complete 4D Gaussian scene from a driving video whose every frame is partly hidden by the hood, the dashboard, windshield reflections or watermarks.
- Amodal geometry recovery. The occluder mask masks the occluder tokens in the global attention layers, so that the feed-forward model recovers cameras, depth and motion from the obstructed frames in a single pass.
- Observed appearance reconstruction. The observability of every pixel is computed from this geometry, and appearance is reconstructed only in the observed regions.
- Generative completion. The unobserved regions are filled by an image diffusion model and optimized into the Gaussian scene.
- AmodalDrive. The model is trained on AmodalDrive, a paired dataset that composites occluder layers separated from in-the-wild dashcam videos onto clean driving scenes.
Installation
git clone https://github.com/phai-lab/AGT.git
cd AGT
Main environment (reconstruction, scene optimization, evaluation):
conda create -n agt python=3.10 -y
conda activate agt
pip install torch==2.4.1 torchvision==0.19.1 --index-url https://download.pytorch.org/whl/cu121
pip install -r requirements.txt
pip install --no-build-isolation --no-binary gsplat gsplat==1.5.3
pip install --no-build-isolation third_party/dggt/third_party/pointops2
Completion environment (generative completion):
conda create -n agt-completion python=3.12 -y
conda activate agt-completion
pip install torch==2.9.1 --index-url https://download.pytorch.org/whl/cu128
pip install -r requirements-completion.txt
Optional environments
- Mask generation for your own clips: SAM 3 and the Qwen3.5 verifier each run in their own environment. Install
SAM 3 by following its repository, and install
requirements-masks.txtfor the verifier. The verifier runsQwen/Qwen3.5-35B-A3Blocally with vLLM. - Benchmark rebuild:
requirements-rebuild.txtand a static build of ffmpeg 7.0.2.
Checkpoints
The AGT weights are hosted at MRBSTUDIO/AGT.
hf download MRBSTUDIO/AGT agt_reconstruction.safetensors agt_completion_lora.safetensors --local-dir checkpoints/
hf download zbww/tapip3d tapip3d_final.pth --local-dir checkpoints/
mv checkpoints/tapip3d_final.pth checkpoints/motion_head.pth
| File | Content | Size |
|---|---|---|
agt_reconstruction.safetensors |
feed-forward reconstruction model | 4.9 GB |
agt_completion_lora.safetensors |
LoRA of FLUX.1 Fill used in the generative completion | 0.7 GB |
FLUX.1-Fill-dev and SegFormer are loaded from the Hugging Face Hub, or from local copies given with --flux and
--segformer.
Demo
The example clips of the project page are part of the dataset repository. Run the commands from the repository root.
hf download MRBSTUDIO/AmodalDrive --repo-type dataset --include "examples/*" --local-dir AmodalDrive
python inference.py \
--case AmodalDrive/examples/real-a \
--out outputs/real-a \
--completion-python "$(conda run -n agt-completion which python)"
Add --reconstruction-only to run AGT without generative completion; this needs only the main environment.
Outputs are rendered at 518x294.
Inference on your own video
Cut a clip from the video:
python tools/prepare_clip.py --video drive.mp4 --start 12 --out work/export
Generate its occluder mask. SAM 3 proposes regions in the SAM 3 environment, Qwen3.5 verifies them in the verifier environment, and the frames vote in the main environment:
python tools/make_masks.py --export work/export --out work/masks --stage propose
python tools/make_masks.py --export work/export --out work/masks --stage verify
python tools/make_masks.py --export work/export --out work/masks --stage finish
Run AGT:
python inference.py --export work/export --mask-dir work/masks --out outputs/my_clip \
--completion-python "$(conda run -n agt-completion which python)"
The output directory holds the rendered frames and depth of every clip.
Evaluation
Build the benchmark first, see Dataset. Both commands use the precomputed occluder masks of AmodalDrive.
AGT without completion:
python -m agt.recon.reconstruct render --inputs AmodalDrive/exports/test --out outputs/test_feedforward \
--masks dataset --data-root AmodalDrive
python eval/score.py --config configs/eval/test_waymo.json --data-root AmodalDrive \
--export AmodalDrive/exports/test --method outputs/test_feedforward --out scores/test_feedforward
AGT (the method directory is <out>/final):
python inference.py --export AmodalDrive/exports/test --masks dataset --data-root AmodalDrive \
--out outputs/test_full --completion-python "$(conda run -n agt-completion which python)"
python eval/score.py --config configs/eval/test_waymo.json --data-root AmodalDrive \
--export AmodalDrive/exports/test --method outputs/test_full/final --out scores/test_full
--clips ID ... restricts inference.py to a subset of the export. configs/eval/val_waymo.json scores the
validation export.
Dataset
AmodalDrive provides the occluder layers, the pairing tables, the splits, the occluder masks and the example clips.
hf download MRBSTUDIO/AmodalDrive --repo-type dataset --local-dir AmodalDrive
Download the Waymo Open Dataset v2.0.1, then run the scripts below to build the composed validation and test data. They preprocess the scenes, compute the labels used by the scorer, and compose and export the clips.
python tools/build_waymo_scenes.py --data-root AmodalDrive --waymo-root WAYMO --split val --split test \
--ffmpeg /path/to/ffmpeg --ffprobe /path/to/ffprobe
python tools/make_labels.py depth --data-root AmodalDrive --waymo-root WAYMO --split val --split test
python tools/make_labels.py sky --data-root AmodalDrive --waymo-root WAYMO --split val --split test
python tools/make_labels.py visibility --data-root AmodalDrive --dggt-checkpoint checkpoints/model_latest_waymo.pt \
--split val --split test
python tools/export_clips.py --data-root AmodalDrive --split val --out AmodalDrive/exports/val
python tools/export_clips.py --data-root AmodalDrive --split test --protocol full --out AmodalDrive/exports/test
WAYMO is the parquet download (<split>/<component>/<segment>.parquet, splits validation, testing and
testing_location). The visibility label uses the depth of the released DGGT Waymo checkpoint, downloaded from
xiaomi-research/dggt.
Code Structure
AGT/
βββ inference.py runs AGT on an example case, a new clip or a benchmark export
βββ agt/
β βββ masks/ occluder mask generation with a pluggable verifier
β βββ prepare/ clip export from a video
β βββ model/ model construction, masked attention and observability
β βββ recon/ feed-forward reconstruction and rendering
β βββ completion/ render completion
β βββ refine/ scene optimization
β βββ data/ AmodalDrive reader with on-the-fly composition
β βββ dataset/ scene preprocessing and label generation
β βββ eval/ scorer
βββ eval/score.py scoring entry
βββ tools/ clip preparation, mask generation, benchmark rebuild
βββ configs/ model, completion, scene optimization, mask, dataset and evaluation settings
βββ third_party/dggt/ the DGGT files used by this code
Citation
@misc{bi2026agt,
title = {AGT: Amodal 4D Reconstruction from Obstructed Driving Videos},
author = {Bi, Bodong and Chen, Nuo and Xu, Hongyu and Kong, Xiaoqiang and Huang, Baoru and Nguyen, Anh and Zhou, Yang and Fan, Zhiwen},
year = {2026},
note = {arXiv preprint, coming soon}
}
Acknowledgements
This code builds on the following projects. We thank their authors.
- DGGT: the feed-forward 4D Gaussian model AGT is fine-tuned from.
- VGGT: the geometry backbone of DGGT.
- gsplat: Gaussian rasterization.
- FLUX.1-Fill: the image completion model.
- TAPIP3D and CoTracker: the motion head.
- SAM 3 and Qwen3.5: occluder mask generation.
- Waymo Open Dataset, nuScenes, Argoverse 2, BDD100K and MM-AU: data sources.
License
- Code: Apache License 2.0, see
LICENSE. Vendored third-party code keeps its own license, seeNOTICE. - Weights and dataset: CC BY-NC 4.0.