[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-116059":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":15,"stars7d":17,"stars30d":17,"stars90d":16,"forks30d":16,"starsTrendScore":18,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":10,"pushedAt":25,"updatedAt":26,"readmeContent":27,"aiSummary":28,"trendingCount":16,"starSnapshotCount":16,"syncStatus":15,"lastSyncTime":29,"discoverSource":30},116059,"UGG","amanikiruga\u002FUGG","amanikiruga","Unified Generative Geometry Model NeurIPS 2026 official repo ","",null,"Python",93,7,4,2,0,17,9,56.91,"Other",false,"main",true,[],"2026-11-07 12:38:24","2026-11-23 03:34:41","\u003Cdiv align=\"center\">\n\n# UGG\n\nOne video diffusion model that predicts **RGB, depth and camera rays** for every frame of a clip.\n\n\u003C\u002Fdiv>\n\nUGG fine-tunes Wan2.2-TI2V-5B into a mixture-of-transformers with three experts:\nRGB, camera rays (Plücker direction and moment) and depth. They share self-attention over the\nconcatenated sequence `[rgb | ray | depth]`. Training uses diffusion forcing: any subset of\nframes and modalities can be clean (given), and the model generates the rest. One checkpoint\ntherefore handles:\n\nvideo → 4D, image (+ cameras) → 4D, first\u002Flast frame (+ cameras) → 4D, text → 4D,\ncameras → 4D and depth → 4D (see [the six tasks](#the-six-tasks)).\n\nThe code layout follows [Large Video Planner](https:\u002F\u002Fgithub.com\u002Fbuoyancy99\u002Flarge-video-planner):\nHydra configs in `configurations\u002F`, Lightning modules in `algorithms\u002F`, data in `datasets\u002F`,\nand the training loop in `experiments\u002F`, all launched by `main.py`.\n\n```\nUGG\u002F\n├── ugg\u002F                  inference API: UGG.from_pretrained(), the six tasks, camera + depth coding, video IO, camera-path videos\n├── assets\u002F               sample scenes for every task (Bonn, RE10K, DL3DV) + text prompts\n├── infer.py              command-line inference (Hydra)\n├── main.py               training entry point (Hydra + Lightning), as in LVP\n├── algorithms\u002Fwan\u002F       the model (wan_t2v_ray_depth_mot_concat_5b.py) and Wan modules\n├── datasets\u002F             the 14 training datasets, the mixture, and a dummy dataset\n├── experiments\u002F          Lightning trainer \u002F FSDP setup\n├── configurations\u002F\n│   ├── algorithm\u002Fugg.yaml        release model: weights path, sampling defaults, training recipe\n│   ├── algorithm\u002Fugg_toy.yaml    2-block debug model\n│   ├── experiment\u002Fugg_train.yaml release training recipe (optimizer, batch, checkpointing)\n│   ├── dataset\u002Fmixture_parallax14.yaml   release training mixture\n│   └── inference.yaml            inference defaults (mode, seed, cameras, depth decode)\n├── scripts\u002Ftrain_release.sbatch  multi-node launcher\n└── tests\u002F\n```\n\n# Checkpoints\n\n| | path |\n|---|---|\n| Release weights (30 GB, bf16) | Hugging Face [`amanim71\u002FUGG`](https:\u002F\u002Fhuggingface.co\u002Famanim71\u002FUGG) (`ugg_release.safetensors`), downloaded on first use |\n| Wan2.2-TI2V-5B (DiT config, VAE, UMT5-XXL) | Hugging Face `Wan-AI\u002FWan2.2-TI2V-5B`, cached under `$HF_HOME` |\n\nThe release path is set in [configurations\u002Falgorithm\u002Fugg.yaml](configurations\u002Falgorithm\u002Fugg.yaml)\n(`model.tuned_ckpt_path`); override it with `algorithm.model.tuned_ckpt_path=...` (a local\n`.safetensors`\u002F`.ckpt` file or `\u003Cuser>\u002F\u003Crepo>\u002F\u003Cfile>` on the Hub). After installing the environment\nbelow and setting `HF_HOME` to your data volume, fetch everything ahead of time:\n\n```bash\nhf download amanim71\u002FUGG ugg_release.safetensors\nhf download Wan-AI\u002FWan2.2-TI2V-5B --include \"config.json\" --include \"Wan2.2_VAE.pth\" --include \"models_t5_umt5-xxl-enc-bf16.pth\" --include \"google\u002F*\"\npython -c 'from transformers import AutoTokenizer; AutoTokenizer.from_pretrained(\"google\u002Fumt5-xxl\")'\n```\n\n# Environment setup\n\n```bash\nconda create -n ugg python=3.12 && conda activate ugg\npip install torch==2.9.0 torchvision==0.24.0 --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu129\npip install -r requirements.txt\n```\n\nFlash attention is recommended but not necessary. To install the prebuilt 2.8.3 flash attention wheel:\n```bash\npip install --no-deps \"https:\u002F\u002Fgithub.com\u002FDao-AILab\u002Fflash-attention\u002Freleases\u002Fdownload\u002Fv2.8.3\u002Fflash_attn-2.8.3%2Bcu12torch2.9cxx11abiTRUE-cp312-cp312-linux_x86_64.whl\"\n```\n\nTo install from Flash attention 2.7.4.post1 source, requires torch already installed, a C++ compiler, and Cuda 12.9 `nvcc`. \n```bash\npip install ninja packaging psutil setuptools wheel\nMAX_JOBS=8 pip install flash-attn==2.7.4.post1 --no-build-isolation --no-deps --no-cache-dir\n```\n\n```bash\nexport HF_HOME=\u002Fpath\u002Fto\u002Fhf_cache   # where the Wan2.2 files are cached\nexport HF_HUB_OFFLINE=1            # optional: for compute nodes without internet\n```\n\nInference needs one 80 GB GPU (about 40 GB peak; add 11 GB for T5 when using prompts).\n\n# Inference\n\n### The six tasks\n\nEvery task is the same model with a different set of clean (given) inputs; the rest is generated.\n\n| task | given | generated | Python | trained setting |\n|---|---|---|---|---|\n| video → 4D | all frames | depth, cameras | `model.video_to_4d(video)` | yes |\n| image + cameras → 4D | first frame, cameras | frames, depth | `model.image_to_4d(img, cameras=...)` | yes |\n| first\u002Flast + cameras → 4D | first + last frame, cameras | frames, depth | `model.first_last_to_4d(a, b, cameras=...)` | yes |\n| text → 4D | caption | frames, depth, cameras | `model.text_to_4d(prompt)` | approximately* |\n| cameras → 4D | cameras (+ caption) | frames, depth | `model.camera_to_4d(cameras)` | zero-shot |\n| depth → 4D | depth (+ caption) | frames, cameras | `model.depth_to_4d(depth)` | zero-shot |\n\nAlso available: `image_to_4d(img)` (image only) and `model(video, mode=\"sparse\")` (first + last\nframe, no cameras: the paper's sparse protocol). Training drew from five settings: first frame;\nall frames; first + last frame + cameras; first frame + cameras; first frame + depth. Their history\ntokens were themselves partially noised, so *text-only matches a fully-noised first frame. Cameras-\nor depth-only without any frame was never trained and is zero-shot.\n\n`model.generate(video=... | images=[...], observe=\"all\"|\"first\"|\"first_last\", cameras=..., depth=..., prompt=...)`\ntakes any combination directly.\n\n### Sample inputs\n\n`assets\u002F` holds one scene per task, picked because they work well:\n\n| folder | source | contents | use it for |\n|---|---|---|---|\n| `bonn_balloon2\u002F` | Bonn RGB-D Dynamic | `frames.mp4` (50 frames) | video → 4D |\n| `re10k_staircase\u002F` | RealEstate10K test | `first.png`, `last.png`, `cameras.npz`, `frames.mp4` | image + cameras → 4D |\n| `re10k_bedroom\u002F` | RealEstate10K test | same | first\u002Flast + cameras → 4D |\n| `dl3dv_gallery\u002F` | DL3DV-10K test | same + `caption.txt` | camera → 4D; image \u002F first-last + cameras → 4D |\n| `dl3dv_treatment_room\u002F` | DL3DV-10K test | same + `caption.txt`, `depth.npz` (metric, 0 = invalid) | depth → 4D |\n| `text_prompts.json` | | indoor camera-motion captions | text → 4D |\n\n`cameras.npz` stores the dataset's ground-truth cameras: `c2w` (T, 4, 4) is OpenCV\ncamera-to-world with the first camera at the origin, and `intrinsics` (T, 3, 3) is in pixels of\nthe 288×384 model input. `frames.mp4` is the real clip, for comparing against what the model\ngenerates. `caption.txt` is the dataset's caption of the clip.\n\n**Captions matter most when little is given.** For camera- and depth-conditioned generation the\ncaption is the only appearance cue: without it, camera → 4D invents an unrelated scene and depth\n→ 4D comes out dark and colourless. With frames given, a caption changes little (RE10K bedroom:\n27.4 vs 27.2 dB). A caption that does not describe the clip actively hurts. RE10K captions\ndescribe the whole video, so the staircase clip's caption, which describes the house exterior,\nturns the indoor shot into a garden. Leave `prompt` empty unless you have a caption for the\nclip itself.\n\n**Generation varies with the seed.** On the staircase, image + cameras scores 18–25 dB PSNR\nacross seeds 0–2 and 213. Try a few seeds for generation tasks; reconstruction (video → 4D)\nvaries far less.\n\n`python scripts\u002Frun_examples.py` runs every example below with its recommended settings and\nwrites them to `outputs\u002Fexamples\u002F`.\n\n### Python\n\n```python\nimport numpy as np\nfrom ugg import UGG\n\nmodel = UGG.from_pretrained()                      # release weights + protocol defaults\ncams = lambda s: tuple(np.load(f\"assets\u002F{s}\u002Fcameras.npz\")[k] for k in (\"c2w\", \"intrinsics\"))\n\n# video -> 4D\npred = model.video_to_4d(\"assets\u002Fbonn_balloon2\u002Fframes.mp4\")\n# image + cameras -> 4D\npred = model.image_to_4d(\"assets\u002Fre10k_staircase\u002Ffirst.png\", cameras=cams(\"re10k_staircase\"),\n                         hist_guidance=1.5, sample_shift=0.9, seed=2)\n# first + last image + cameras -> 4D\npred = model.first_last_to_4d(\"assets\u002Fre10k_bedroom\u002Ffirst.png\", \"assets\u002Fre10k_bedroom\u002Flast.png\",\n                              cameras=cams(\"re10k_bedroom\"), hist_guidance=1.5, sample_shift=0.7,\n                              sample_steps=60, seed=97)\n# text -> 4D\npred = model.text_to_4d(\"The camera glides forward down a long marble corridor, past a colonnade of pale \"\n                        \"stone arches that recede into soft daylight. Tall windows cast long rectangles of \"\n                        \"light across the polished floor, and a vaulted ceiling curves overhead.\",\n                        num_frames=50, text_guidance=5.0, seed=11)\ncaption = lambda s: open(f\"assets\u002F{s}\u002Fcaption.txt\").read().strip()\n# camera trajectory -> 4D (the caption supplies the appearance)\npred = model.camera_to_4d(cams(\"dl3dv_gallery\"), prompt=caption(\"dl3dv_gallery\"), hist_guidance=2.0, seed=29)\n# depth -> 4D (anchored on the first and last frame: the trained pattern; drop images= for depth alone)\ndepth = np.load(\"assets\u002Fdl3dv_treatment_room\u002Fdepth.npz\")[\"depth\"].astype(np.float32)\npred = model.depth_to_4d(depth, images=[\"assets\u002Fdl3dv_treatment_room\u002Ffirst.png\", \"assets\u002Fdl3dv_treatment_room\u002Flast.png\"],\n                         prompt=caption(\"dl3dv_treatment_room\"), hist_guidance=2.0, seed=59)\n\npred.rgb            # (T, H, W, 3) uint8\npred.depth          # (T, H, W) relative depth (up to scale)\npred.depth_norm     # (T, H, W) raw output: normalized disparity in [-1, 1]\npred.c2w            # (T, 4, 4) camera-to-world (translation up to scale)\npred.intrinsics     # (T, 3, 3)\npred.save(\"out\u002F\")   # rgb.mp4, depth.mp4, cameras.mp4, *.npy, meta.json\n```\n\nAny call takes `seed`, `sample_steps`, `sample_shift`, `hist_guidance`, `text_guidance`,\n`prompt`, `shared_intrinsics`, `percentile_clip` and `max_frames`; unset arguments take the\nconfig defaults. The values above are the ones that worked best per task. Generation tasks\nlike more history guidance (1.5–2) than reconstruction (1.0), and text needs strong text\nguidance (5). Cameras from one prediction can drive another (`cameras=pred`). To change\ndefaults once, pass Hydra overrides:\n\n```python\nmodel = UGG.from_pretrained(overrides=[\"algorithm.sample_steps=20\", \"seed=42\", \"percentile_clip=10\"])\nmodel = UGG.from_pretrained(ckpt=\"\u002Fpath\u002Fto\u002Fother.ckpt\")\n```\n\nLoading reads the 30 GB checkpoint. On a network filesystem, copying it to local disk or\n`\u002Fdev\u002Fshm` first and passing `ckpt=` makes loading several times faster.\n\n### Command line\n\n```bash\npython infer.py task=video      input=assets\u002Fbonn_balloon2\u002Fframes.mp4 output_dir=out\u002Fvideo\npython infer.py task=video      input=assets\u002Fbonn_balloon2\u002Fframes.mp4 mode=sparse seed=1\npython infer.py task=image      input=assets\u002Fre10k_staircase\u002Ffirst.png cameras=assets\u002Fre10k_staircase\u002Fcameras.npz \\\n                                algorithm.hist_guidance=1.5 algorithm.sample_shift=0.9 seed=2\npython infer.py task=first_last input=assets\u002Fre10k_bedroom\u002Ffirst.png last=assets\u002Fre10k_bedroom\u002Flast.png \\\n                                cameras=assets\u002Fre10k_bedroom\u002Fcameras.npz algorithm.hist_guidance=1.5 \\\n                                algorithm.sample_shift=0.7 algorithm.sample_steps=60 seed=97\npython infer.py task=text       'prompt=\"The camera glides forward down a long marble corridor ...\"' \\\n                                algorithm.lang_guidance=5 seed=11\npython infer.py task=camera     cameras=assets\u002Fdl3dv_gallery\u002Fcameras.npz algorithm.hist_guidance=2 seed=29 \\\n                                prompt=\"'$(cat assets\u002Fdl3dv_gallery\u002Fcaption.txt)'\"\npython infer.py task=depth      depth=assets\u002Fdl3dv_treatment_room\u002Fdepth.npz algorithm.hist_guidance=2 seed=59 \\\n                                prompt=\"'$(cat assets\u002Fdl3dv_treatment_room\u002Fcaption.txt)'\" \\\n                                input=assets\u002Fdl3dv_treatment_room\u002Ffirst.png last=assets\u002Fdl3dv_treatment_room\u002Flast.png   # optional anchors\n```\n\n### Defaults and what they mean\n\n| key | default | |\n|---|---|---|\n| `task` | `video` | CLI only: which inputs are given (table above). |\n| `mode` | `dense` | `task=video` only. `dense`: all RGB frames are history. `sparse`: frames 0 and T-1 only. |\n| `num_frames` | 50 | clip length when no video or cameras fix it (text, image alone). |\n| `algorithm.sample_steps` | 40 | UniPC steps (shift 3.0). 10 steps costs little on outdoor depth. |\n| `algorithm.hist_guidance` | 1.0 | guidance on the clean frames: `f·(1+h) − h·f_no_history`. 0 skips the extra forward pass. |\n| `algorithm.lang_guidance` | 0.0 | text classifier-free guidance; needs `prompt`. |\n| `prompt` | null | null means an all-zero text embedding, which is what the paper numbers use. |\n| `seed` | 0 | the depth\u002Fpose protocol seed (the NVS protocol uses 42). |\n| `max_frames`, `frame_mode` | 50, `contig_first` | uses the first M frames, where M is the largest value ≤ 50 with M % 4 == 2. `uniform` spreads them over the video instead. |\n| `dataset.height`, `dataset.width` | 288, 384 | the input is center-cropped to 3:4 and then resized. |\n| `shared_intrinsics` | true | fits one K per clip when recovering cameras from rays (much better rotation). |\n| `percentile_clip` | 2.0 | disparity floor for the depth decode; 10 measured better outdoors. |\n| `dit_bf16` | true | runs the DiT in bf16. |\n\n\n# Training\n\n### Smoke test (one GPU, a few minutes)\n\n```bash\npython -m main +name=smoke experiment=ugg_train algorithm=ugg_toy dataset=dummy \\\n  dataset.n_frames=10 dataset.height=160 dataset.width=192 dataset.raymap_height=20 dataset.raymap_width=24 \\\n  experiment.training.batch_size=1 experiment.training.max_steps=4 wandb.mode=disabled\n```\n\n`ugg_toy` is the release model truncated to 2 blocks, and `dummy` produces random tensors in the\ntraining-sample format. Together they run the full path: VAE encode, diffusion-forcing noise,\nloss, FSDP, the optimizer step and checkpointing.\n\n### Training data\n\nThe mixture reads every dataset from one root, `data_dir` (set in\n[configurations\u002Fconfig.yaml](configurations\u002Fconfig.yaml) or on the command line):\n\n```\n\u003Cdata_dir>\u002F\n├── tartanair\u002F  tartanair_v2\u002F  spring\u002F  bedlam\u002F  bedlam2\u002F  vkitti2\u002F  mid_air\u002F  mvs_synth\u002F\n├── ase\u002F  scenenet\u002F  scenenet_gt_poses\u002F  matrixcity\u002F  omniworld_game\u002F\n├── re10k\u002F  dl3dv_colmap\u002F  dl3dv_colmap_prompt_embeds\u002F\n└── captions\u002F\u003Cdataset>\u002F      precomputed UMT5 caption embeddings (optional per dataset)\n```\n\nEach loader's docstring in `datasets\u002F` describes the layout it expects. Symlinks are fine.\n\n### The release recipe\n\n```bash\npython -m main +name=ugg_finetune experiment=ugg_train algorithm=ugg dataset=mixture_parallax14 \\\n  data_dir=\u002Fpath\u002Fto\u002Fdata experiment.num_nodes=6\n# or on SLURM (6 nodes x 4 GPUs, requeue-safe):\nREPO=$PWD HF_HOME=... sbatch scripts\u002Ftrain_release.sbatch data_dir=\u002Fpath\u002Fto\u002Fdata\n```\n\nTo check that the full model trains on your hardware before a long run (one node with 4 × 80 GB\nGPUs, random data, about 25 minutes, mostly weight loading):\n\n```bash\npython -m main +name=full_smoke experiment=ugg_train algorithm=ugg dataset=dummy \\\n  dataset.n_frames=10 dataset.height=160 dataset.width=192 dataset.raymap_height=20 dataset.raymap_width=24 \\\n  experiment.training.batch_size=1 experiment.training.max_steps=2 algorithm.save_startup_checkpoint=false \\\n  wandb.mode=disabled\n```\n\n| | release fine-tuning |\n|---|---|\n| init | weights-only warm start (`algorithm.model.tuned_ckpt_path`) |\n| trainable | RGB + ray experts (8.78 B). The depth expert (3.78 B) is frozen with `gf_freeze_depth`. |\n| objective | flow matching, diffusion forcing `ray_depth_prediction_firstlast`, clean-token loss masked |\n| data | `mixture_parallax14`: 14 datasets, 288×384, 50 frames |\n| batch | 8 per GPU × 24 H200 = 192 |\n| optimizer | AdamW (fp32 state), lr 6e-6 constant after 150 warmup steps, betas (0.9, 0.95), wd 0.05, clip 1.0 |\n| memory | FSDP hybrid shard within node, `use_orig_params`, gradient checkpointing 0.93 |\n| hardware | at least 4 × 80 GB GPUs per node: 3 × 80 GB runs forward and backward but OOMs at the first AdamW step |\n| speed | FA3, compiled VAE encoder, merged FLF chunks: ≈ 8.5 s\u002Fstep |\n| release | step 2250 |\n\n\n### Training arguments\n\n- `experiment=ugg_train`: [configurations\u002Fexperiment\u002Fugg_train.yaml](configurations\u002Fexperiment\u002Fugg_train.yaml):\n  LR, batch size, max steps, checkpoint cadence, FSDP flags.\n- `algorithm=ugg`: [configurations\u002Falgorithm\u002Fugg.yaml](configurations\u002Falgorithm\u002Fugg.yaml):\n  initial weights, expert freeze, LR schedule, diffusion-forcing settings per dataset.\n- `dataset=mixture_parallax14`: [configurations\u002Fdataset\u002Fmixture_parallax14.yaml](configurations\u002Fdataset\u002Fmixture_parallax14.yaml):\n  the subsets, their sampling weights and `mixture_seed`.\n- Resume: `load=\u003Crun>\u002Fcheckpoints\u002Flast.ckpt` restores weights, optimizer and step\n  (`train_release.sbatch` does this automatically on requeue).\n- Logging: set `wandb.entity` in [configurations\u002Fconfig.yaml](configurations\u002Fconfig.yaml), or `wandb.mode=disabled`.\n\n# Tests\n\n```bash\npython tests\u002Ftest_cpu.py                                # CPU: imports, configs, video IO, depth decode, cameras\npython tests\u002Fgpu_smoke.py                               # GPU: all six tasks on assets\u002F, one model load\npython tests\u002Ftest_flash_attention.py                    # GPU: optional FA2 forward\u002Fbackward numerical checks; requires FA2\n```\n\n# Intended Use and Responsible Use\nUGG is intended for research on video generation and 4D scene understanding.\nOutputs may contain inaccurate geometry or synthetic content. Users should\ndisclose generated content and avoid deceptive, privacy-invasive, or\nsafety-critical applications without independent validation.\n\n# Acknowledgements\n\nThis repo is forked from [Boyuan Chen](https:\u002F\u002Fboyuan.space\u002F)'s research template\n[repo](https:\u002F\u002Fgithub.com\u002Fbuoyancy99\u002Fresearch-template). By its MIT license, you must keep the\nabove sentence in `README.md` and the `LICENSE` file to credit the author. The model code builds on\n[Wan2.2](https:\u002F\u002Fgithub.com\u002FWan-Video\u002FWan2.2) and follows the layout of\n[Large Video Planner](https:\u002F\u002Fgithub.com\u002Fbuoyancy99\u002Flarge-video-planner). The sample scenes in\n`assets\u002F` come from the Bonn RGB-D Dynamic, RealEstate10K and DL3DV-10K datasets.\n\n\n\n","UGG 是一个统一的生成式几何视频扩散模型，能够为视频每一帧同时预测 RGB 图像、深度图和相机光线（Plücker 表示）。其核心技术是基于 Wan2.2-TI2V-5B 的 MoE 架构，三个专家（RGB\u002Fdepth\u002Fray）共享自注意力机制，并支持任意子集模态与帧的扩散式生成。模型统一支持六类输入条件下的 4D 视频生成，包括文本→视频、图像+相机→视频、首末帧→视频、纯相机路径→视频等。适用于三维内容创作、神经渲染、具身智能仿真及多模态视频理解等需要联合建模几何与外观的场景。","2026-11-24 04:52:41","CREATED_QUERY"]