Skip to content

Galaxeaaa/HotSpot

Repository files navigation

HotSpot: Signed Distance Function Optimization with an Asymptotically Sufficient Condition

Zimo Wang*, Cheng Wang*, Taiki Yoshino, Sirui Tao, Ziyang Fu, Tzu-Mao Li (* denotes equal contribution)

Paper | Project Page | Code

Please follow the installation instructions below.

Installation

Our code was tested with Python 3.9.19, torch 2.4.1, tensorboardX 2.6.2.2, CUDA 11.8 on Ubuntu 20.04.6 LTS.

We also provide a docker image that pre-installed all the requirements above in the conda environment named torch. Use /workspace/conda init <your_shell> to initialize the conda environment for your shell. Then follow the instructions below to activate the environment and install the requirements. For a full list of requirements see the requirement.txt file. Note we also use plotly for visualisation, which needs to be installed from conda.

Example installation code if you are using the docker image:

/workspace/conda init <your_shell> # Change <your_shell> to your shell, e.g. bash, zsh, fish
conda activate torch
pip install -r requirements.txt
conda install -y -c plotly plotly plotly-orca 

Example installation code if you are not using the docker image:

conda create -n torch python=3.9
conda activate torch
pip install -r requirements.txt
conda install -y -c plotly plotly plotly-orca
# Install with instructions from https://pytorch.org/get-started/locally/
# Below is instructions for installation of latest version of PyTorch with CUDA 11.8
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

Usage

1. Testing on 2D Shapes (No External Data required)

We inherit from StEik a 2D shape dataset generator (./dataset/shape_base.py and ./dataset/shape_2d.py) that includes three shapes: Circle, L shape polygon, and Koch snowflake. We also designed 10 more shapes with more complex topology to test our idea. The code generally allows any polygonal shape to be used and can be extended to other 2D shapes.

To train a 2D shape neural representation and reconstruct the surface (curve in this case) for all the shapes run the script

bash ./scripts/run_hotspot_2d.sh

The script takes a config file located in ./configs/hotspot_2d.toml as an argument. This will create a folder ./log/2D/HotSpot/ where the results are stored.

After training, use the following script to compute the metrics

bash ./scripts/run_metric_2d.sh <PATH_TO_EXPERIMENT>

If you use the script above, the path to the experiment should be ./log/2D/HotSpot/.

2. Surface Reconstruction

2.1 Data Preparation

2.1.1 Surface Reconstruction Benchamark data

The Surface Reconstruction Benchmark (SRB) data is provided in the Deep Geometric Prior repository, and can be downloaded from this link (1.12 GB).

If you use this data in your research, make sure to cite the Deep Geometric Prior paper.

2.1.2 ShapeNet data

We use a subset of the ShapeNet data as chosen by Neural Splines. This subset is first preprocessed to be watertight as per the pipeline in the Occupancy Networks repository, who provide both the pipleline and the entire preprocessed dataset (73.4 GB).

The data you should download for training includes the preprocessed data (412.8 MB) and the resulting point clouds (371 MB) of this subset.

For our distance metrics computation, we ran the data preprocessing pipeline introduced in Occupancy Networks and provide the watertight meshes (376.1 MB) for this subset. The watertight meshes are all translated and scaled to exactly match the point clouds provided above.

If you use this data in your research, make sure to cite the ShapeNet and Occupancy Network papers, and if you report on this split, compare with and cite the Neural Spline paper.

2.1.3 High genus data

We also run experiment on some high genus shapes. It is composed of two parts: NIE dataset (5 shapes, 34.7 MB) used in A Level Set Theory for Neural Implicit Evolution under Explicit Flows, and nested voronoi spheres (2 shapes, 27.6 MB).

If you use this data in your research, cite A Level Set Theory for Neural Implicit Evolution under Explicit Flows.

2.1.4 Scene Reconstruction data

For scene reconstruction, we used the scene from the SIREN paper.

If you use this data in your research, make sure to cite the SIREN paper.

2.2 Running Surface Reconstruction

To train, test and evaluate on ShapeNet run

bash scripts/run_hotspot_shapenet.sh

Similarly we provide a script for SRB:

bash scripts/run_hotspot_srb.sh

and for high genus shapes:

bash scripts/run_hotspot_nie.sh

and for scene reconstruction:

bash scripts/run_hotspot_scene.sh

These scripts take a config file located in ./configs/ as an argument. The config files are named hotspot_shapenet.toml, hotspot_srb.toml, and hotspot_scene.toml respectively.

3. Ray Tracing

Instructions to be added.

Acknowledgements

Our code is built on top of the code from DiGS and StEik, but is significantly modified.

License and Citation

If you find our work useful in your research, please cite our paper:

Preprint

@misc{wang2024hotspotscreenedpoissonequation,
      title={HotSpot: Screened Poisson Equation for Signed Distance Function Optimization}, 
      author={Zimo Wang and Cheng Wang and Taiki Yoshino and Sirui Tao and Ziyang Fu and Tzu-Mao Li},
      year={2024},
      eprint={2411.14628},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2411.14628}, 
}

See LICENSE file.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •