IGGT4D causal geometry model — v19r10, step 5676
This repository contains the exact step-5676 model export and its complete standalone streaming inference implementation. No training repository, CPFS mount, DA3 teacher, VAE, or additional model weights are required.
The network predicts depth, rays, camera parameters and optional instance features from RGB. It does not generate or reconstruct RGB.
Install and download
Use Python 3.10–3.12 and a CUDA GPU. The supplied fused-attention code requires CUDA. Validation used PyTorch 2.6.0+cu124 on H20.
python -m venv .venv
source .venv/bin/activate
pip install torch==2.6.0 torchvision==0.21.0 --index-url https://download.pytorch.org/whl/cu124
pip install 'huggingface_hub>=0.36'
python -c "from huggingface_hub import snapshot_download; snapshot_download('cyun9286/IGGT4D-causal-v19r10-step5676', local_dir='iggt5676')"
cd iggt5676
pip install -r requirements.txt
Run commands from this directory so Python uses the supplied iggt4d/ package.
Video or image-directory inference
python inference.py \
--input /path/to/video.mp4 \
--output outputs/video \
--width 672 --height 378 \
--window 64 --pose ray \
--save-instance --save-ply --save-preview
--input also accepts a directory of naturally sorted PNG/JPG/WebP images.
Use --max-frames 129 to limit a run, --start-frame 0 and --stride 1 to
control sampling. Width and height must be divisible by 14. The CLI uses a
center crop and resize; API users must supply already prepared RGB frames.
Outputs:
frames/000000.npz, etc.: depth, confidence, ray-derived and camera-head camera matrices, intrinsics and source-frame indices.--save-instanceadds the raw eight-channel instance feature map (not clustered instance IDs).global_rgb.ply: optional RGB point cloud, appended with bounded host memory. Points use the selected predicted pose and raw predicted scale. Only invalid or nonpositive depth is removed; there is no ground-truth alignment.preview.mp4: optional input/depth comparison. Input RGB is shown directly.summary.json: frame count, configuration, elapsed time and PyTorch peak allocated GPU memory.
The CLI exports OpenCV camera-to-world (c2w) 4×4 matrices, and pixel-unit
intrinsics for the output resolution. The upstream high-level API normally
returns world-to-camera extrinsics; invert c2w when that convention is needed.
--pose camera selects camera-head poses for the main output and point cloud;
both ray and camera-head poses are always saved.
Streaming Python API
import torch
from models import load_iggt, stream_step
from pose import ray_geometry, camera_geometry
network = load_iggt('model.safetensors', 'cuda')
cache = None
for rgb in your_frame_iterator:
# rgb: CUDA float32 RGB [B,1,3,H,W], range [0,1].
# Each call contains exactly one frame. Keep B/H/W fixed within a stream.
pred, cache = stream_step(network, rgb, cache, window=64, run_instance=True)
K_ray, c2w_ray = ray_geometry(pred, 0, rgb.shape[-2], rgb.shape[-1])
K_camera, c2w_camera = camera_geometry(pred['camera_encoding'], rgb.shape[-2], rgb.shape[-1])
# Consume/offload this frame's predictions before processing the next frame.
cache = None # reset between scenes or when changing batch/resolution
The pose helpers and CLI are intended for batch size one; the lower-level
stream_step supports batched RGB and returns batched raw predictions.
ray_geometry uses the official ray solver with confidence, a fixed per-frame
seed of zero and isolated CPU/CUDA RNG state. It does not disturb subsequent
sampling RNG. For multi-GPU applications, use one process per GPU.
Causality and cache behavior
- One RGB frame enters the backbone per call, using historical KV only.
- ImageNet normalization happens inside
stream_step. Do not normalize twice. - The working attention window includes 64 frames total, counting the current frame and persistent frame-zero anchor. After a call, at most 63 frames of KV are retained for the next query: the anchor and recent history.
- Later frames do not rewrite earlier predictions. The CLI does not run the upstream instance-ID merger or its optional historical-mask rewriting.
- The backbone architecture, spatial RoPE, learned camera tokens and heads are retained. This wrapper adds bounded KV trimming and stable pose extraction.
- There is no ground-truth pose input, future RGB lookahead, per-video scale fitting, or teacher inference in this streaming path.
The matching source tree contains additional full-causal training methods;
the streaming wrapper does not call those methods. It uses the evaluated
single-frame use_cache=True path.
Verification and provenance
validation_report.json records actual GPU checks on this exact exported
weight file, including raw-output and cache agreement with the matching training
wrapper over 70 frames, crossing the 64-frame eviction boundary, and the
per-frame ray solver/RNG checks. inference_manifest.json records source hashes.
export_metadata.json describes the original weight export. Its statement that
the export operation itself used no GPU remains true; the separately recorded
inference validation was performed when publishing this code package.
model.safetensors preserves the original checkpoint tensors and dtypes.
The full state includes backbone, depth/ray head, camera components and instance
head. Four feature layers are 19, 27, 33 and 39. Optimizer state is excluded;
exact training resume requires the original training checkpoint.
The upstream source and license notices are retained; see LICENSE and
THIRD_PARTY_NOTICES.md. Check package integrity with sha256sum -c SHA256SUMS.