# AGT: Amodal 4D Reconstruction from Obstructed Driving Videos [![arXiv](https://img.shields.io/badge/arXiv-coming%20soon-b31b1b.svg)](#citation) [![Project Page](https://img.shields.io/badge/Project-Page-2ea44f.svg)](https://agt4d.github.io/) [![Weights](https://img.shields.io/badge/%F0%9F%A4%97%20Weights-MRBSTUDIO%2FAGT-ffcc4d.svg)](https://huggingface.co/MRBSTUDIO/AGT) [![Dataset](https://img.shields.io/badge/%F0%9F%A4%97%20Dataset-AmodalDrive-ffcc4d.svg)](https://huggingface.co/datasets/MRBSTUDIO/AmodalDrive) [Bodong Bi](https://bodongbi.pages.dev/)1*, [Nuo Chen](https://nuochen1203.github.io/)2*, [Hongyu Xu](https://hyxu2006.github.io/)3, [Xiaoqiang Kong](https://scholar.google.com/citations?user=9w1tWaUAAAAJ)2, [Baoru Huang](https://baoru.netlify.app/)4, [Anh Nguyen](https://www.csc.liv.ac.uk/~anguyen/)4, [Yang Zhou](https://yangzhou.engr.tamu.edu/)2, [Zhiwen Fan](https://zhiwenfan.github.io/)2† 1University of Michigan   2Texas A&M University   3General Motors   4University of Liverpool *Equal contribution   †Corresponding author AGT reconstructs a complete 4D scene from an obstructed driving video
## 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.
AGT pipeline
## Installation ```bash git clone https://github.com/phai-lab/AGT.git cd AGT ``` **Main environment** (reconstruction, scene optimization, evaluation): ```bash 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): ```bash 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.txt` for the verifier. The verifier runs `Qwen/Qwen3.5-35B-A3B` locally with vLLM. - **Benchmark rebuild**: `requirements-rebuild.txt` and a static build of ffmpeg 7.0.2.
## Checkpoints The AGT weights are hosted at [MRBSTUDIO/AGT](https://huggingface.co/MRBSTUDIO/AGT). ```bash 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. ```bash 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: ```bash 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: ```bash 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: ```bash 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](#dataset). Both commands use the precomputed occluder masks of AmodalDrive. **AGT without completion**: ```bash 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 `/final`): ```bash 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](https://huggingface.co/datasets/MRBSTUDIO/AmodalDrive) provides the occluder layers, the pairing tables, the splits, the occluder masks and the example clips. ```bash hf download MRBSTUDIO/AmodalDrive --repo-type dataset --local-dir AmodalDrive ``` Download the [Waymo Open Dataset](https://waymo.com/open/) 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. ```bash 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 (`//.parquet`, splits `validation`, `testing` and `testing_location`). The visibility label uses the depth of the released DGGT Waymo checkpoint, downloaded from [xiaomi-research/dggt](https://huggingface.co/xiaomi-research/dggt/resolve/main/model_latest_waymo.pt). ## Code Structure ```text 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 ```bibtex @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](https://xiaomi-research.github.io/dggt/): the feed-forward 4D Gaussian model AGT is fine-tuned from. - [VGGT](https://github.com/facebookresearch/vggt): the geometry backbone of DGGT. - [gsplat](https://github.com/nerfstudio-project/gsplat): Gaussian rasterization. - [FLUX.1-Fill](https://huggingface.co/black-forest-labs/FLUX.1-Fill-dev): the image completion model. - [TAPIP3D](https://github.com/zbw001/TAPIP3D) and [CoTracker](https://github.com/facebookresearch/co-tracker): the motion head. - [SAM 3](https://github.com/facebookresearch/sam3) and [Qwen3.5](https://huggingface.co/Qwen/Qwen3.5-35B-A3B): occluder mask generation. - [Waymo Open Dataset](https://waymo.com/open/), [nuScenes](https://www.nuscenes.org/), [Argoverse 2](https://www.argoverse.org/av2.html), [BDD100K](https://www.vis.xyz/bdd100k/) and [MM-AU](https://github.com/jeffreychou777/LOTVS-MM-AU): data sources. ## License - **Code**: Apache License 2.0, see `LICENSE`. Vendored third-party code keeps its own license, see `NOTICE`. - **Weights and dataset**: CC BY-NC 4.0.