This repository demonstrates how learning Shape Symmetries and properly configuring Differentiable Rendering improves 3D reconstruction networks.
Check out here the related method of Learnable UV-maps
Image-to-3D reconstruction neural networks are essential for various applications (robotics, AR, autonomous driving, AI retail solutions). However, many existing networks often overlook real-world object features, such as rotation/reflection symmetries. This results in lower accuracy, induces various artifacts and makes network training more difficult because outputs are represented inefficiently with excessive degrees of freedom. Based on this, we propose an approach that:
- detects object symmetry types and selects the corresponding optimal 3D representation for detailed reconstruction with fewer network parameters and faster training.
- introduces a robust scheme applicable to various types of symmetries and neural networks, including networks with minimal input data (single-view RGB, occluded images)
- enables significant increase in output resolution of pretrained networks by adjusting their loss functions alone
- repairs artifacts of existing networks caused by redundant 3D representations
- preserves well texture details of reconstructed objects by aligning their UV-maps with the symmetry axis.
Symmetrical objects can be encoded with less data than asymmetrical ones
Texture quality depends heavily on how surface is unfolded onto the UV-plane (e.g. spherical parametrization vs surface cut through its symmetry plane). Extra DoF often result in surface tearing and lack of smoothness.
Current implementation supports single-view RGB images as input and textured triangle meshes with reflection symmetry as output. It's built on top of the Multi-Category Mesh Reconstruction network (MCMR) with the following major improvements:
-
Reflection scheme to improve 3D accuracy and repair mesh artifacts of the baseline network.
-
Refinement scheme to double output resolution, while maintaining the same number of learnable parameters.
-
PyTorch3D differentiable renderer integrated with backbone network (instead of SoftRas) to improve texture and 3D details.
-
Additional utilities for better visualization and more accurate evaluation of geometric errors.
It requires only redefinition of 3D losses and fine-tuning (same architecture and same number of parameters)

Choosing the right differential renderer has a significant impact on the network's ability to recover surface detail and texture.
- Sampling texture crops of fixed sizes for all triangle results in detail loss (SoftRas)
- To preserve details, textures should be sampled adaptively based on sizes of rendered triangles (Phong shading in Pytorch3D)
New visualization and geometry processing utilities to better evaluate the results, scripts for automation and wider test/train capabilities:
For automatic setup on Ubuntu, prepare data and run
bash ./scripts/install_requirements.sh
bash ./scripts/install_additional_packages.sh
#use link to the dataset you pre-processed or the one you received from the authors
bash ./scripts/download_data.sh
bash ./scripts/download_weights.shFor manual setup, follow these steps:
Follow these instructions to setup environment and prepare dataset for the backbone MCMR network (PyTorch/torchvision, Softras, Pascal3D+)
Install PyTorch3D v0.4.0
conda install -c bottler nvidiacub
pip install fvcore iopath
pip install "git+https://github.com/facebookresearch/pytorch3d.git@v0.4.0"- Install Blender v2.81 to run
cad_processing_pipeline.pyscript for preprocessing of ground truth CAD meshes - Install libigl and PyVista package for 3D alignment and evaluation of additional geometric measures
conda activate <env_name> # environment for MCMR dependencies
conda install -c conda-forge igl # libigl for surface error metrics
conda install -c conda-forge pyvista # for 3D IoU- Install meshplot package for advanced visualization by running
conda install meshplot, or (recommended for Jupyter):
conda create --name <env_name_clone> --clone <env_name> # install package in cloned environment
conda source <env_name_clone> # to avoid python/ipython discrepancies
conda install ipykernel
pip install --upgrade jupyter_client
conda install -c conda-forge meshplot The simplest way to train network is to run the wrapper script:
bash scripts/train_mcmr_pascal3d.sh <weights> <mean_shapes_number> <class_list> <data_index_name> <options>| argument | explanation |
|---|---|
| weights | file for weight initialization (e.g. backbone pretrained weights) |
| mean_shape_number | (optional) configurations for the backbone network (usually, it's number of classes from training data, or 1 ) |
| class_list | list of object classes from Pascal3D (e.g. aeroplane car) |
| data_index_name | (optional) name of the data index file to sample a subset of the training data |
| options | Additional command line arguments passed to the training script (main.py), including --symmetrize flag to enable learnable symmetries |
Examples of training without learnable symmetries:
bash scripts/test_mcmr_pascal3d.sh car_10_MRCNN 10 car small --qualitative_results
bash scripts/train_mcmr_pascal3d.sh plane_car_1_PointRend "aeroplane car" small ""Example of training with learnable symmetries (reflection scheme):
bash scripts/train_mcmr_pascal3d.sh plane_car_1_PointRend "aeroplane car" small --symmetrize
There are other training scripts in script folder named train_<class_list>_symmetric.sh and train_<class_list>_not_symmetric.sh to train symmetrized and non-symmetrized networks with various configurations.
The simplest way to test network is to run the wrapper script:
bash scripts/test_mcmr_pascal3d.sh <weights> <mean_shapes_number> <class_list> <data_index_name> <options>- where command line arguments are the same as during the training
Examples:
bash scripts/test_mcmr_pascal3d.sh car_10_MRCNN 10 car small --qualitative_results
bash scripts/test_mcmr_pascal3d.sh plane_car_1_PointRend 1 "aeroplane car" smallAfter testing baseline networks, you can estimate how much improvements can be achieved with learnable symmetries for these networks by running:
python auxilary/test_postprocessing_par.pyFor more tests on how learning symmetries impacts various pretrained networks, check out scripts/test_symmetrizations.sh
While the code is designed for classical Encoder-Decoder networks, the proposed method is also applicable to other reconstruction methods, including NERFs and neural rendering methods for generating novel views. Further methods for generalization and improvements include direct supervision of UV-map quality and texture symmetrization. For details explore the following resources:
[Learning UV-maps repo] [MCMR paper] [Novel View Neural Rendering] [PyTorch3D Renderer]
Consider citing this work if you find it useful
@misc{naitsat2023,
author = {Naitsat, A.},
title = {Learning Shape Symmetries for 3D Mesh Reconstruction with Differentiable Rendering},
howpublished = {\url{https://github.com/AlexNaitsat/symmetric_mcmr}},
}
This project is licensed under the MIT License - see the LICENSE file for detail





