Skip to content
AoxiangFanPublic

About

Code release of ECCV 2026 paper: Generalizable Neural Reconstruction of High-Fidelity Surfaces via Sparse Volumetric Representations.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Code release of ECCV 2026 paper: Generalizable Neural Reconstruction of High-Fidelity Surfaces via Sparse Volumetric Representations.

SV_Recon

Two-stage generalizable sparse-view surface reconstruction:

  1. Stage 1 — OccPred predicts a coarse occupancy grid (128³) over the normalised scene cube from the source images.
  2. Stage 2 — SVRecon builds a sparse feature volume over the occupied voxels, samples rays through it and renders colour + depth with a ray transformer. The fused depth maps become a mesh via TSDF fusion.

We have the gt_meshes and SV_Recon generated meshes as well as checkpoints available at (https://drive.google.com/drive/folders/1oGlwxtb4s-0xTRfx4HT7I-imqGxNwFV_?usp=sharing). Download the checkpoints from there into weights/ (e.g. weights/SV_Recon.ckpt) to reproduce the released results without training.


Layout

configs/
  models/{occ_pred,sv_recon}.yaml      stage-1 / stage-2 hyper-parameters
  data/{dtu,blendedmvg,co3d}/*.yaml    per-dataset paths and conventions
data_splits/                           DTU pair/lists, BlendedMVG tuples, Co3D list
scripts/                               train / test / eval entry points
src/sv_recon/
  options.py                             dataclass options + YAML/CLI merging
  data.py, train.py                      dataloader / Lightning plumbing
  train_occ.py, train_recon.py           training entry points
  test_occ.py, test_recon.py             evaluation entry points
  dtu_eval.py                            DTU metrics: chamfer + angular/AUC (was dtu_eval.py + dtu_eval2.py)
  model/
    occ_model.py      OccPred            (was codes/model_volume_regression_dense.py)
    recon_model.py    SVRecon            (was codes/model_volume_regression_sampling.py)
    ray_transformer.py                   (was codes/ray_transformer_volume_sparse_reconstruction.py)
    attention/                           (was codes/attention/)
    cnn2d.py, cnn3d.py (dense + sparse 3D conv blocks), cnn3d_regression.py
    feature_extractor.py, renderer.py, sampler.py
  dataset/
    sv_recon_batch_dataset.py            scene normalisation + ray setup (dataloader side)
    generic_mvs_dataset.py, blendedmvg.py
    dtu_train.py, dtu_test.py, co3d_test.py, scene_transform.py
  util/
    scene_utils.py                       frustum / bounding-box / reprojection helpers
    generic_utils.py, geometry_utils.py
    grid_sample.py, optim.py
    mesh_eval.py                         shared helpers for dtu_eval.py (tri sampling, AUC, vis)
    tools/                                standalone CLIs, not imported by any other module
      tsdf_fusion.py                      depth-map fusion -> mesh (fusion env)
      clean_mesh.py                       mask-clean the fused mesh
      depth_fusion.py                     alternate depth-map fusion CLI (not wired into any script)

src/sv_recon is what goes on PYTHONPATH (see scripts/env.sh), so imports are rooted there: from model.occ_model import OccPred, from dataset.dtu_train import ..., from util.optim import MipLRDecay.

options.py must stay at that top level: the config YAMLs and the released checkpoints both reference options.Options / options.DataOptions by module path, so moving it would break configs/**.yaml loading and load_from_checkpoint.

Environments

Two conda environments are needed:

Purpose Interpreter
training, rendering, mesh cleaning, DTU metrics ~/miniforge3/envs/recon
TSDF fusion only (needs pycuda + numba) ~/miniconda3/envs/fusion

scripts/env.sh exports both as $RECON_PY and $FUSION_PY; every script sources it. No paths are baked in — export RECON_PY (required by every script) and FUSION_PY (used only by scripts/eval_dtu.sh) in your shell before running anything, e.g. export RECON_PY=/path/to/envs/recon/bin/python.

Datasets

Please follow VolRecon (https://github.com/IVRL/VolRecon) to prepare the DTU dataset, and the official site of BlendedMVG (https://github.com/yoyo000/blendedmvs) to prepare BlendedMVG dataset.

scripts/env.sh also exports five dataset-root variables:

Variable Dataset
DTU_TEST DTU test split (configs/data/dtu/dtu_test.yaml, scripts/eval_dtu.sh, test_recon.py --dataset dtu)
DTU_TRAIN DTU training split, incl. raw depth maps (configs/data/dtu/{dtu_train,dtu_val}.yaml, DTUTestSingleFormatDataset's depth_dir)
BLENDEDMVG_ROOT BlendedMVG (configs/data/blendedmvg/*.yaml, test_recon.py --dataset blendedmvg)
CO3D_ROOT Co3D subset (configs/data/co3d/co3d_test.yaml, test_recon.py --dataset co3d)
SAMPLESET DTU SampleSet/MVS_Data (ObsMask + Points/stl), used only by scripts/eval_dtu.sh's chamfer metric

Export the ones you need in your shell before running any script, e.g. export DTU_TEST=/path/to/DTU_test (an unexported one just falls back to an obviously-fake /path/to/... placeholder, so a missing dataset fails loudly where it's actually read rather than earlier). The configs/data/**/*.yaml files reference these as ${DTU_TEST} etc. — options.py expands $VAR/~ in every config field on load, so this only works when scripts/env.sh has been sourced first (every scripts/*.sh entry point does this already; a bare python src/sv_recon/train_occ.py ... invocation needs the variables exported by hand). split_filepath / pair_filepath / tuple_info_file_location in those same configs are plain relative paths into data_splits/ (shipped with the repo), resolved from $REPO_ROOT since every script cds there first.

Training

# stage 1, DTU only
bash scripts/train_occ_dtu.sh

# stage 2, DTU only
OCC_CKPT=logs/occ_pred_dtu/OccPred/last.ckpt bash scripts/train_recon_dtu.sh

# DTU + BlendedMVG
bash scripts/train_occ_multi.sh
OCC_CKPT=logs/occ_pred_multi/OccPred/last.ckpt bash scripts/train_recon_multi.sh

Datasets are composed on the command line — --data_config_file a.yaml:b.yaml concatenates them.

Evaluation

# full DTU 3-view pipeline: render -> TSDF fuse -> mask-clean -> chamfer
CKPT=logs/recon_dtu/SVRecon/last.ckpt OUT_DIR=test_results/dtu bash scripts/eval_dtu.sh

# render only, all three datasets
CKPT=... bash scripts/test_recon.sh

# stage-1 precision / recall / F1
CKPT=... bash scripts/test_occ.sh

scripts/eval_dtu.sh uses DTU_TEST / SAMPLESET (both from env.sh) and DTU_GT_MESH, which defaults to the dtu_gt_mesh symlink at the repo root — not tracked by git, so point it at your own copy of the DTU ground-truth meshes, or export DTU_GT_MESH directly. Override any of the three to use your own paths, e.g.:

DTU_TEST=/your/DTU_test SAMPLESET=/your/SampleSet/MVS_Data \
DTU_GT_MESH=/your/dtu_gt_mesh \
CKPT=logs/recon_dtu/SVRecon/last.ckpt OUT_DIR=test_results/dtu bash scripts/eval_dtu.sh

Note that because this code base is a refactored version, the evaluation results may be slightly different from the paper.


Scene conventions

Every dataset emits the same single_output_format dict (images, cam_T_world, K, depth, per-view near/far). SVReconBatchDataset then does all of the scene setup, so training and testing cannot drift apart:

  1. poses are made relative to view 0;
  2. the scene bounding box is the union of the view frusta, padded by bbox_factor = 1.1, and the scene is mapped into the unit cube;
  3. per-view near/far are set by near_far_mode:
    • sphere — 0.95(d−1) .. 1.05(d+1) from the normalised camera distance (DTU, SparseNeuS convention),
    • metric — metric depth range / scene radius (BlendedMVG),
    • fixed — constant [0.01, 1.7] (Co3D);
  4. NDC projection matrices, ray origins/directions and ray-depth maps are derived from the normalised cameras.

At test time source_mode="all" makes every view a source view, and each view is rendered from a virtual camera offset --render_offset along its own x-axis (25 mm on DTU) — the DtuFitSparse protocol.

About

Code release of ECCV 2026 paper: Generalizable Neural Reconstruction of High-Fidelity Surfaces via Sparse Volumetric Representations.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages