Skip to content

Tencent/Light-SQ

Repository files navigation

Light-SQ: Structure-aware Shape Abstraction with Superquadrics for Generated Meshes

SIGGRAPH Asia 2025

TL;DR

We present Light-SQ, a novel superquadric-based optimization framework that explicitly emphasizes structure-awareness.
Teaser

TODO

  • Release V1 pytorch implementation with GPU acceleration, supporting with and without convex decomposition guidance.
  • Provide disjoint region multi-process parallel acceleration.
  • Multiscale fitting script.
  • Structure-aware CoACD code release.
  • Introduce support for latest convex decomposition methods, such as Learning-Convex-Decomposition.

Pull requests for the above features are very welcome!

Requirements

The installation process below has been tested on a Linux machine with NVIDIA T4 GPU from scratch.

  1. Basic Installation, cuda-12.4 as an example
conda create -n lightsq python=3.11
conda activate lightsq
pip install torch==2.5.1 torchvision==0.20.1 --index-url https://download.pytorch.org/whl/cu124
pip install -r requirements.txt
  1. CHECK your installed open3d version

If you are using open3d <= 0.18.0, please downgrade numpy, and install kaolin==0.17.0

$ pip install --upgrade numpy==1.26.4

pip install kaolin==0.17.0 -f https://nvidia-kaolin.s3.us-east-2.amazonaws.com/torch-{TORCH_VERSION}_cu{CUDA_VERSION}.html

# For the version stated above (cu124, torch-2.5.1)
pip install kaolin==0.17.0 -f https://nvidia-kaolin.s3.us-east-2.amazonaws.com/torch-2.5.1_cu124.html

If you are using open3d > 0.18.0, you can continue with numpy-2, and make sure you install kaolin==0.18.0

pip install kaolin==0.18.0 -f https://nvidia-kaolin.s3.us-east-2.amazonaws.com/torch-{TORCH_VERSION}_cu{CUDA_VERSION}.html

# For the version stated above (cu124, torch-2.5.1)
pip install kaolin==0.18.0 -f https://nvidia-kaolin.s3.us-east-2.amazonaws.com/torch-2.5.1_cu124.html
  1. Move to pytorch_minimize and install it.

NOTE: The implementation in this folder differs from the official pytorch minimize. It includes the TRF solver with bound constraints required by our fitting algorithm.

cd pytorch_minimize
pip install -e .

Execution

Run Light-SQ without convex decomposition guidance

  1. SDF computation
  • in_data_dir can be either a folder containing meshes or a mesh filepath.
  • out_data_dir is the output root, for [name].glb, the sdf and visualizations will be stored to [out_data_dir]/[name]/sdf_extraction
python prepare_sdf_cuda.py -i [in_data_dir] -o [output_folder] --device cuda:0 --grid_resolution 100 [--save_viz]

# Example using data/test.glb
python prepare_sdf_cuda.py -i data/test.glb -o outputs --device cuda:0 --grid_resolution 100 --save_viz
  1. Fitting without CoACD
  • in_data_dir should have folder sdf_extraction as is suggested in the previous step
  • if out_data_dir not specified, it will be the same as in_data_dir, and the MPS result will be saved to [in_data_dir]/MPS
  • Specify sdf version to be res[x]_raw or res[x]_eps. The eps version will have better structure completeness.
  • Add -d to activate MPS visualization logging. Turn it off if you want faster execution.
  • For MPS parameters, currently centroid_mode is locked to deepest, do not specify it anymore. Other parameters may have a different default value now, but you can still specify them as you want.
python main_wo_coacd.py -i [in_data_dir] [-d] [-v res100_eps]

# Example using data/test.glb
python main_wo_coacd.py -i outputs/test/ -d -v res100_eps

In the example above, the fitting result will be saved in outputs/test/MPS_Naive.

Run Light-SQ with structure-aware convex decomposition guidance

  1. SDF computation

Same as above.

python prepare_sdf_cuda.py -i [in_data_dir] -o [output_folder] --device cuda:0 --grid_resolution 100 [--save_viz]
  1. Structure-aware CoACD

We offer a precompiled structure-aware CoACD implementation on Linux. WSL2 also works fine. Windows platform is not supported yet.

python coacd_mesh2sdf.py [mesh_path_from_sdf_extraction] [output_folder] [--save_vis]

# Example using data/test.glb
python coacd_mesh2sdf.py \
outputs/test/sdf_extraction/test_res100_eps_mc.ply \ # we recommend using res100_eps version
outputs/test/coacd \ # specify the coacd subfolder
--save_vis
  1. Fitting with convex decomposition guidance
pyhton main_with_coacd.py -i [input_folder] [-d]
# E.g., without debug logs
python main_with_coacd.py -i outputs/test
# E.g., with debug logs
python main_with_coacd.py -i outputs/test -d

In the example above, the fitting result will be saved in outputs/test/MPS_with_CoACD.

Citation

If you find our work useful for your research, please consider citing our paper:

@inproceedings{wang2025light,
  title={Light-SQ: Structure-aware Shape Abstraction with Superquadrics for Generated Meshes},
  author={Wang, Yuhan and Chen, Weikai and Hu, Zeyu and Zhang, Runze and Yin, Yingda and Wu, Ruoyu and Luo, Keyang and Qian, Shengju and Ma, Yiyan and Li, Hongyi and Gao, Yuan and Zhou, Yuhuan and Luo, Hao and Wang, Wan and Shen, Xiaobin and Li, Zhaowei and Zhu, Kuixin and Hong, Chuanlang and Wang, Yueyue and Feng, Lijie and Wang, Xin and Loy, Chen Change},
  booktitle={Proceedings of the SIGGRAPH Asia 2025 Conference Papers},
  year={2025}
}

References

We borrow code from the following repositories:

Many thanks to the authors for sharing their code! Review the license terms of this project before use.

About

No description, website, or topics provided.

Resources

License

Stars

17 stars

Watchers

3 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors