We present Light-SQ, a novel superquadric-based optimization framework that explicitly emphasizes structure-awareness.
- 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!
The installation process below has been tested on a Linux machine with NVIDIA T4 GPU from scratch.
- 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- CHECK your installed
open3dversion
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.htmlIf 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- Move to
pytorch_minimizeand 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 .- SDF computation
in_data_dircan be either a folder containing meshes or a mesh filepath.out_data_diris 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- Fitting without CoACD
in_data_dirshould have foldersdf_extractionas is suggested in the previous step- if
out_data_dirnot specified, it will be the same asin_data_dir, and the MPS result will be saved to[in_data_dir]/MPS - Specify sdf version to be
res[x]_raworres[x]_eps. Theepsversion will have better structure completeness. - Add
-dto activate MPS visualization logging. Turn it off if you want faster execution. - For MPS parameters, currently
centroid_modeis locked todeepest, 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_epsIn the example above, the fitting result will be saved in outputs/test/MPS_Naive.
- 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]- 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- 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 -dIn the example above, the fitting result will be saved in outputs/test/MPS_with_CoACD.
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}
}
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.