MCPcopy Index your code
hub / github.com/alibaba-damo-academy/former3d

github.com/alibaba-damo-academy/former3d @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
223 symbols 439 edges 26 files 40 documented · 18%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

3D Former: Monocular Scene Reconstruction with SDF 3D Transformers

This is the official PyTorch implementation code for 3D-Former. For technical details, please refer to:

3D Former: Monocular Scene Reconstruction with SDF 3D Transformers

Weihao Yuan, Xiaodong Gu, Heng Li, Zilong Dong, Siyu Zhu

ICLR 2023

[Project Page] | [Paper]

  

  

Bibtex

If you find this code useful in your research, please cite:

@inproceedings{yuan2022former3d,
  title={3D Former: Monocular Scene Reconstruction with 3D SDF Transformers},
  author={Yuan, Weihao and Gu, Xiaodong and Li, Heng and Dong, Zilong and Zhu, Siyu},
  booktitle={Proceedings of the International Conference on Learning Representations},
  pages={},
  year={2023}
}

Contents

  1. Installation
  2. Datasets
  3. Training
  4. Evaluation
  5. Model

Installation

conda create -n former3d python=3.8
conda activate former3d

# Attention: The version of torchvision should be the same in training and inference. Mismatched version may generate strange results.
conda install pytorch-gpu=1.10.0 torchvision=0.9 cudatoolkit=11.1

pip install \
  pytorch-lightning==1.5 spconv-cu111==2.1.21 setuptools==59.5.0 scikit-image==0.18\
  numba pillow wandb tqdm pyyaml matplotlib black imageio easydict numpy_indexed \
  opencv-python open3d pyrender ray trimesh pycuda

pip install -e .

Datasets

You can prepare the ScanNet data according to here, or download from scannet and tsdf. Then modify the data path in the config files to your dataset locations.

Training

python scripts/train.py --config config_localtest.yml --gpus 4

Evaluation

First inference the meshes by

python scripts/inference.py --ckpt model.ckpt --outputdir results/test --split test --config config.yml --n-imgs 200 --cropsize 64

If the memory is not enough, you can reduce n-imgs with a small performance decrease.

Then evaluate the generated meshes by

MESA_GL_VERSION_OVERRIDE=4.1 python scripts/evaluate.py --results_dir results/test --split test --config config.yml --n_proc 0

Also, you can evaluate the meshes following TransformerFusion to avoid penalizing more complete reconstruction.

Model

Model Acc. Comp Chamfer Prec Recall F-score
Evaluation 1 0.049 0.068 0.058 0.754 0.664 0.705
Evaluation 2 0.032 0.062 0.047 0.829 0.694 0.754

The reconstructed meshes used for evaluation is available at here.

Acknowledgements

Thanks to Stier Noah for opening source of the excellent work VoRTX. Thanks to Jiageng Mao for opening source of the excellent work VOTR.

Core symbols most depended-on inside this repo

change_default_args
called by 8
former3d/net3d/sparse3d.py
upsample_feats
called by 4
former3d/sdfformer.py
get_volume
called by 3
former3d/tsdf_fusion.py
formerTensor2spconvTensor
called by 3
former3d/net3d/sparse3d.py
bxyz2bzyx
called by 3
former3d/net3d/sparse3d.py
autocast_norm
called by 3
former3d/net3d/sparse3d.py
mesh_opengl
called by 2
scripts/evaluate.py
rigid_transform
called by 2
former3d/tsdf_fusion.py

Shape

Method 114
Function 69
Class 40

Languages

Python93%
C++7%

Modules by API surface

former3d/net3d/sparse3d.py46 symbols
former3d/net3d/ops/former_utils.py42 symbols
former3d/tsdf_fusion.py21 symbols
former3d/lightningmodel.py19 symbols
former3d/sdfformer.py13 symbols
former3d/transformer.py9 symbols
former3d/net3d/ops/src/build_attention_indices.cpp9 symbols
former3d/data.py9 symbols
former3d/utils.py8 symbols
scripts/inference.py7 symbols
scripts/evaluate.py7 symbols
former3d/mv_fusion.py6 symbols

For agents

$ claude mcp add former3d \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact