# Repository Briefing: nathalie000/4DAnything
> Source: https://repoforai.com/repo/nathalie000/4DAnything (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/nathalie000/4DAnything
- **Category**: Voice, Vision & Video (语音 / 视觉 / 视频生成)
- **Primary Language**: Python
- **License**: MIT
- **Engineering Health**: B+ (75/100 · Maintenance 35/35 · Adoption 9/25 · Releases 11/20 · License 20/20)
- **Review Snapshot**: 2026-12-03
- **Deployment / Stack Signals**: Local AI, GPU, CLI
- **Momentum**: 159 ★ total (+14 24h / +14 7d) · 7 forks
- **When to Use**: Best for: Research and prototyping teams with Linux NVIDIA GPU capacity that need to reconstruct one moving object from a short monocular clip and inspect it from novel viewpoints. Skip if: You need joint multi-object reconstruction, cannot meet the GPU memory requirements, or need a commercial deployment without resolving upstream weight licenses.

## Overview
```text
### Architecture & Core Mechanics
4DAnything is a staged local CLI for reconstructing one moving object from a monocular clip. `inference/precompute.py` writes masks, pointmaps, and camera poses to a clip-specific directory. `inference/infer.py` consumes those inputs and reconstructs the object over the whole clip in one forward pass. `inference/visualize.py` renders the result with gsplat. The artifact directory is the integration boundary: callers can inspect segmentation before launching reconstruction or provide their own masks upstream.

SAM 3D Objects supplies the reconstruction backbone and Gaussian decoder. TRELLIS provides sparse structured latents, and PAD3R supplies node deformation and skinning. The Python package lives under `anything4d/`, with JSON configs included as package data. The GPU stack pins PyTorch 2.6.0, torchvision 0.21.0, xformers, CUDA 12.4 builds of spconv and PyTorch3D, and gsplat. The CLI and its intermediate files, rather than a service API or plugin interface, are the practical entry points for integration.

### Key Capabilities & Differentiators
The input is a monocular video, with one target object per run. By default, BiRefNet selects the salient object in the middle frame and SAM 2.1 tracks its mask across the clip. `--prompt` uses Grounding-DINO to locate a named target; `--box` and `--point` allow explicit selection, and `--masks` accepts masks from another segmentation workflow. Inspecting `precompute/masks/` is the quickest way to catch incorrect target selection before reconstruction.

VGGT-Omega estimates pointmaps and camera poses jointly for the clip to maintain consistent depth scale across frames. MoGe is available as an optional source of per-frame pointmaps. The output is a reconstruction of the target as it moves or deforms over time, not a joint reconstruction of all visible objects. The visualizer renders the reconstruction from the input camera, overlays it on the original video, and produces an orbit view. Comparing the overlay with the orbit helps distinguish alignment errors from geometry problems visible at novel viewpoints.

### Trade-offs & Limitations
Use SAM 3D Objects directly if you only need a static reconstruction from one image, or VGGT-Omega directly if the deliverables are pointmaps and camera poses. 4DAnything is worth the extra dependencies when you need an object representation that changes over time and can be rendered from novel views. Its one-object-per-run design is a poor fit for joint scene reconstruction, and work grows with the number of objects you select because each needs its own run.

The single forward pass describes reconstruction, not the full cost of segmentation, geometry estimation, and rendering. The GPU memory requirement is at least 24 GB for 32 frames and about 48 GB for 50 frames, so validate at your target clip length rather than extrapolating from a short test. Licensing is a separate adoption constraint: the code is MIT, but the upstream weights have independent terms, including the FAIR Noncommercial Research License for VGGT-Omega. Local execution does not turn those weights into a commercially cleared stack.

### Hardware & Deployment Guide
The documented deployment baseline is Linux, an NVIDIA GPU, Python 3.11, and CUDA 12.4. The package metadata allows Python 3.10 or newer, but Python 3.11 is the documented setup. Initialize the recursive Git submodules, install `requirements.txt`, and install the package in editable mode. The requirements pin Git revisions of VGGT-Omega and MoGe and use additional wheel indexes for the CUDA stack. Keep the Torch and CUDA wheel versions aligned rather than upgrading one component in isolation.

Execution is local, but initial setup requires downloading dependencies and checkpoints. Obtain Hugging Face access to SAM 3D Objects and VGGT-Omega, authenticate, and run `scripts/download_checkpoints.sh`; VGGT-Omega downloads on first use. The clip reconstruction checkpoints are `ss.pt`, `slat.pt`, and `decoder.pt` under `checkpoints/4danything/`. Inference code and weights are available without a tagged GitHub release. Record the repository revision and checkpoint files together for reproducible deployments.
```

## Key Capabilities
```text
- Pipeline: `precompute.py`, `infer.py`, and `visualize.py` exchange artifacts through one output directory per clip.
- Target selection: BiRefNet selects the salient object in the middle frame by default; Grounding-DINO supports text selection and SAM 2.1 propagates masks across the clip.
- Geometry: VGGT-Omega estimates pointmaps and camera poses jointly across the clip; MoGe is an optional per-frame pointmap source.
- Reconstruction: SAM 3D Objects supplies the backbone and Gaussian decoder; the pipeline uses TRELLIS sparse structured latents and PAD3R node deformation and skinning.
- Rendering: gsplat produces views from the input camera, overlays on the source video, and orbit videos.
- GPU sizing: Budget at least 24 GB of GPU memory for 32 frames and about 48 GB for 50 frames.
```

## Quick Start / Clone
```bash
git clone https://github.com/nathalie000/4DAnything.git
cd 4DAnything
git submodule update --init --recursive
conda create -n 4danything python=3.11 -y && conda activate 4danything
pip install -r requirements.txt
pip install -e .
```
