### Install Project Dependencies Source: https://github.com/eyeline-labs/vista4d/blob/main/README.md Installs all other project dependencies listed in the requirements.txt file. ```bash pip3 install -r requirements.txt ``` -------------------------------- ### Render Single Point Cloud Example Source: https://github.com/eyeline-labs/vista4d/blob/main/README.md Renders a single point cloud for a given example and resolution. Supports '384p' and '720p' resolutions. To output point clouds without temporal persistence, set RENDER_ONLY_NECESSARY=false. ```bash EXAMPLE=couple-newspaper RESOLUTION=720p bash scripts/preprocess/example_render_single.sh ``` ```bash RENDER_ONLY_NECESSARY=false EXAMPLE=couple-newspaper RESOLUTION=720p bash scripts/preprocess/example_render_single.sh ``` -------------------------------- ### Launch Camera UI Source: https://github.com/eyeline-labs/vista4d/blob/main/README.md Starts the Viser server, FastAPI backend, and React frontend for the camera UI. Access the UI by opening http://localhost:9999 in your browser. ```bash bash cam_ui/startup.sh ``` -------------------------------- ### Launch Full Camera UI Stack Source: https://context7.com/eyeline-labs/vista4d/llms.txt Starts the complete camera UI stack, including Viser, FastAPI, and React. This command opens the UI in a web browser. ```bash # Launch the full camera UI stack (Viser + FastAPI + React) bash cam_ui/startup.sh # Opens: http://localhost:9999 ``` -------------------------------- ### Download Evaluation Dataset Source: https://context7.com/eyeline-labs/vista4d/llms.txt Downloads the official Vista4D evaluation dataset from Hugging Face. Ensure you have the huggingface-cli installed. ```bash # Download evaluation dataset huggingface-cli download Eyeline-Labs/Vista4D-Eval-Data \ --repo-type dataset --local-dir eval_data tar -xvf eval_data/eval_data.tar -C eval_data/ ``` -------------------------------- ### Install Flash Attention and XFuser Source: https://github.com/eyeline-labs/vista4d/blob/main/README.md Installs Flash Attention version 2.8.3 and XFuser with Flash Attention support version 0.4.5. The FLASH_ATTENTION_FORCE_BUILD variable can be set to TRUE to force compilation from source. ```bash export FLASH_ATTENTION_FORCE_BUILD="TRUE" # Optional: If you want to force a compilation from source pip3 install flash-attn==2.8.3 --no-build-isolation # This might take a while if you are compiling from source pip3 install "xfuser[flash-attn]==0.4.5" ``` -------------------------------- ### Install Node.js for React Frontend Source: https://github.com/eyeline-labs/vista4d/blob/main/README.md Installs Node.js version 25 using Conda Forge. This is required for the React-based frontend of the camera UI. ```bash conda install conda-forge::nodejs=25 # Slightly older versions probably work, this is just the newest one at the time of writing ``` -------------------------------- ### Render Point Cloud with Edits Source: https://github.com/eyeline-labs/vista4d/blob/main/README.md Renders a scene's point cloud after applying specified edits. Configure EXAMPLE and RESOLUTION. Output is saved to a specified directory. ```bash EXAMPLE=hike_cow RESOLUTION=720p bash scripts/preprocess/example_render_edit.sh ``` -------------------------------- ### Install PyTorch Source: https://github.com/eyeline-labs/vista4d/blob/main/README.md Installs PyTorch version 2.10.0 and Torchvision version 0.25.0 for CUDA 12.8. ```bash pip3 install torch==2.10.0 torchvision==0.25.0 --index-url https://download.pytorch.org/whl/cu128 ``` -------------------------------- ### Run Vista4D Inference Source: https://github.com/eyeline-labs/vista4d/blob/main/README.md Performs Vista4D inference on the rendered point cloud for a given example and resolution. Outputs are stored in './results/single/$EXAMPLE/vista4d_$RESOLUTION/'. ```bash EXAMPLE=couple-newspaper RESOLUTION=720p bash scripts/inference/example_inference_single.sh ``` -------------------------------- ### Dynamic Scene Expansion (DSE) Setup Source: https://context7.com/eyeline-labs/vista4d/llms.txt Supplements a source video with environmental captures to reduce hallucination and expand the scene. The joint reconstruction is stored in a `recon_and_seg` folder with a `clips.json` file detailing frame ranges for source and DSE content. ```bash # Dynamic Scene Expansion (DSE) Setup # ... (details about clips.json and folder structure) ``` -------------------------------- ### Install CUDA Toolkit and C++ Compiler Source: https://github.com/eyeline-labs/vista4d/blob/main/README.md Installs CUDA toolkit version 12.8 and a compatible C++ compiler into the Conda environment. Sets CUDA_HOME and LD_LIBRARY_PATH environment variables. ```bash conda install -c nvidia cuda-toolkit=12.8 conda install -c conda-forge gxx_linux-64 # Ensure a compatible C++ compiler export CUDA_HOME=$CONDA_PREFIX # Required for the environment setup export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH ``` -------------------------------- ### Render Point Cloud with DSE Source: https://github.com/eyeline-labs/vista4d/blob/main/README.md Unprojects source clips and DSE frames into a single 4D point cloud, then renders it. Configure EXAMPLE, RESOLUTION, and DSE_FRAME_INTERVAL. Renders are saved to a specified directory. ```bash EXAMPLE=lounge-cup RESOLUTION=720p bash scripts/preprocess/example_render_dse.sh ``` -------------------------------- ### API: Check Load Status and Get First-Frame Camera Source: https://context7.com/eyeline-labs/vista4d/llms.txt Retrieves the current loading status of a reconstruction folder and provides details about the first frame's camera intrinsics and other properties. ```bash # API: Check load status + get first-frame camera curl http://localhost:9998/api/load-status # {"status":"loaded","loaded":true,"num_frames":49,"fps":30.0, # "first_frame_camera":{"intrinsics":{"fx":...,"fy":...,"cx":...,"cy":...},...}} ``` -------------------------------- ### Download and Install Cloudflared for Tunneling Source: https://github.com/eyeline-labs/vista4d/blob/main/README.md Downloads the cloudflared executable and makes it executable. This is used to create secure tunnels for accessing the UI on remote GPU nodes without direct port access. ```bash curl -L --output cloudflared https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 chmod +x cloudflared ``` -------------------------------- ### Vista4D Inference with Edits Source: https://github.com/eyeline-labs/vista4d/blob/main/README.md Performs Vista4D inference on a scene with applied edits. Supports USP multi-GPU inference. Configure EXAMPLE and RESOLUTION. ```bash EXAMPLE=hike_cow RESOLUTION=720p bash scripts/inference/example_inference_edit.sh ``` -------------------------------- ### Run 4D Reconstruction and Segmentation Source: https://github.com/eyeline-labs/vista4d/blob/main/README.md Executes a script for 4D reconstruction and dynamic mask segmentation. Configurable by 'EXAMPLE' for video selection and 'RECON_METHOD' for reconstruction method (pi3 or da3). ```bash EXAMPLE=couple-newspaper RECON_METHOD=pi3 bash scripts/preprocess/example_recon_and_seg_single.sh ``` -------------------------------- ### Vista4D Inference with DSE Source: https://github.com/eyeline-labs/vista4d/blob/main/README.md Performs Vista4D inference using Dynamic Scene Expansion (DSE) data. Supports USP multi-GPU inference. Configure EXAMPLE and RESOLUTION. Outputs are saved to a specified directory. ```bash EXAMPLE=lounge-cup RESOLUTION=720p bash scripts/inference/example_inference_dse.sh ``` -------------------------------- ### 4D Reconstruction with DSE Source: https://github.com/eyeline-labs/vista4d/blob/main/README.md Jointly reconstructs and segments source clips and paired scene captures using Dynamic Scene Expansion (DSE). Results are saved to a specified directory. Configure EXAMPLE and RECON_METHOD. ```bash EXAMPLE=lounge-cup RECON_METHOD=pi3 bash scripts/preprocess/example_recon_and_seg_dse.sh ``` -------------------------------- ### Start Cloudflared Tunnels for UI Access Source: https://github.com/eyeline-labs/vista4d/blob/main/README.md Opens two separate tunnels using cloudflared: one for the React frontend (port 9999) and one for the Viser backend (port 9997). This is for remote GPU nodes without inbound port access. ```bash ./cloudflared tunnel --url http://localhost:9999 # React frontend ``` ```bash ./cloudflared tunnel --url http://localhost:9997 # Viser backend (for the iframe) ``` -------------------------------- ### Initialize Vista4DPipeline for Novel-View Synthesis Source: https://context7.com/eyeline-labs/vista4d/llms.txt This Python code shows how to initialize the `Vista4DPipeline` by loading configurations and model checkpoints from local paths. It specifies model paths, data types, and device for GPU acceleration. ```python import torch import yaml import numpy as np from PIL import Image from diffsynth.pipelines.wan_video_vista4d import Vista4DPipeline, ModelConfig from utils.media import load_video, load_cameras, load_masks # Build pipeline from local checkpoints vista4d_config_path = "./checkpoints/vista4d/720p49_step=3000/config.yaml" with open(vista4d_config_path) as f: vista4d_config = yaml.safe_load(f) wan_name = "Wan2.1-T2V-14B" model_configs = [ ModelConfig( path=list(__import__("glob").glob(f"./checkpoints/wan/{wan_name}/diffusion_pytorch_model*.safetensors")), skip_download=True, ), ModelConfig( path=list(__import__("glob").glob(f"./checkpoints/wan/{wan_name}/models_t5_umt5-xxl-enc-bf16.pth")), skip_download=True, ), ModelConfig( path=list(__import__("glob").glob(f"./checkpoints/wan/{wan_name}/Wan2.1_VAE.pth")), skip_download=True, ), ] tokenizer_config = ModelConfig( path=list(__import__("glob").glob(f"./checkpoints/wan/{wan_name}/google/*")), skip_download=True, ) pipe = Vista4DPipeline.from_pretrained( torch_dtype=torch.bfloat16, device="cuda", model_configs=model_configs, tokenizer_config=tokenizer_config, vista4d_config=vista4d_config, vista4d_checkpoint="./checkpoints/vista4d/720p49_step=3000/dit.pth", use_usp=False, # Set True for multi-GPU unified sequence parallel vram_limit=40.0, # Available VRAM in GB minus 2 ) ``` -------------------------------- ### Download Wan2.1-T2V-14B Base Model Source: https://github.com/eyeline-labs/vista4d/blob/main/README.md Downloads the Wan2.1-T2V-14B base model checkpoint to the specified local directory. ```bash hf download Wan-AI/Wan2.1-T2V-14B --local-dir ./checkpoints/wan/Wan2.1-T2V-14B ``` -------------------------------- ### Download Vista4D Evaluation Dataset Source: https://github.com/eyeline-labs/vista4d/blob/main/README.md Use the huggingface-cli to download the Vista4D evaluation dataset. Ensure you extract the contents after downloading. ```bash huggingface-cli download Eyeline-Labs/Vista4D-Eval-Data --repo-type dataset --local-dir eval_data ``` ```bash tar -xvf eval_data/eval_data.tar -C eval_data/ ``` -------------------------------- ### Download Vista4D Checkpoints Source: https://github.com/eyeline-labs/vista4d/blob/main/README.md Downloads the Vista4D checkpoints to the specified local directory. Use --include to download specific variants. ```bash hf download Eyeline-Labs/Vista4D --local-dir ./checkpoints/vista4d ``` ```bash hf download Eyeline-Labs/Vista4D --local-dir ./checkpoints/vista4d --include "384p49_step=30000/*" OR "720p49_step=3000/*" ``` -------------------------------- ### Render Point Cloud with Vista4D Core API Source: https://context7.com/eyeline-labs/vista4d/llms.txt This Python code demonstrates loading inputs and rendering a point cloud from target cameras using the `render_video` function. It supports basic rendering and double reprojection for diagnostics. ```python import numpy as np import torch from utils.point_cloud.render_video import render_video from utils.media import load_video, load_cameras, load_masks, load_depths # Load inputs video, fps = load_video("results/single/parkour/recon_and_seg/video.mp4") # (F,H,W,3) uint8 depths = load_depths("results/single/parkour/recon_and_seg/depths", dtype=np.float16).astype(np.float32) cam_c2w_src, intrinsics_src = load_cameras("results/single/parkour/recon_and_seg/cameras.npz") cam_c2w_tgt, intrinsics_tgt = load_cameras("media/single/parkour_truck-left.npz") dynamic_mask = load_masks("results/single/parkour/recon_and_seg/dynamic_mask") # bool (F,H,W) static_mask = ~dynamic_mask # Render point cloud from target cameras (basic) video_pc, depths_pc, alpha_mask_pc, dynamic_mask_pc = render_video( video=video[:49], depths=depths[:49], cam_c2w_src=cam_c2w_src[:49], cam_c2w_tgt=cam_c2w_tgt, intrinsics_src=intrinsics_src[:49], intrinsics_tgt=intrinsics_tgt, dynamic_mask=dynamic_mask[:49], static_mask=static_mask[:49], render_dynamic_mask=True, dtype=torch.float32, device="cuda", verbose=True, ) # Returns: (F,H,W,3) uint8, (F,H,W) float32, (F,H,W) bool, (F,H,W) bool # Render with double reprojection (for ablation/diagnostics) (video_pc, depths_pc, alpha_pc, dyn_pc), \ (video_pc_ntp, depths_ntp, alpha_ntp, dyn_ntp), \ (video_pc2, depths_pc2, alpha_pc2, dyn_pc2) = render_video( video=video[:49], depths=depths[:49], cam_c2w_src=cam_c2w_src[:49], cam_c2w_tgt=cam_c2w_tgt, intrinsics_src=intrinsics_src[:49], intrinsics_tgt=intrinsics_tgt, dynamic_mask=dynamic_mask[:49], static_mask=static_mask[:49], render_dynamic_mask=True, double_reprojection=True, # Enables NTP + double-reprojection outputs dtype=torch.bfloat16, # Use bfloat16 for speed/memory savings device="cuda", ) ``` -------------------------------- ### Render Point Cloud with Edits Source: https://context7.com/eyeline-labs/vista4d/llms.txt Renders a point cloud with applied edits for 4D scene recomposition. Requires the reconstruction/segmentation folder, camera path, and an edits path in JSON format. ```bash python3 -m scripts.preprocess.render_single \ --recon_and_seg_folder ./results/edit/hike/recon_and_seg \ --cam_path ./media/edit/hike_cow.npz \ --edits_path ./media/edit/hike_cow.json \ --output_folder ./results/edit/hike_cow/render_720p \ --height 720 --width 1280 --num_frames 49 \ --render_only_necessary ``` -------------------------------- ### Full Evaluation Dataset Inference (Single GPU) Source: https://context7.com/eyeline-labs/vista4d/llms.txt Runs the full inference pipeline on the evaluation dataset using a single GPU. Ensure the resolution is set appropriately. ```bash # Full eval inference (single GPU) RESOLUTION=720p bash scripts/inference/example_inference_eval.sh # Output: ./results/eval/vista4d_720p/