This repository contains the project developed by me (Damiano Bonaccorsi), Alessio Santangelo and Takla Trad, for the exam of Advanced Machine Learning, academic year 2021/22.
The topic of the project, as the name of the repository suggests, is point cloud reconstruction and completion. A paper-like report is available under docs/final_report_v*.pdf
.
You can run sh setup_environment.sh
for a full-fledged setup that will also download the ShapeNet dataset.
Alternatively, you can run python3 -m pip install -r requirements.txt
to install the Python dependencies only.
Note: we used Python 3.9.7 all throughout the project, if you happen to have problems while installing dependencies for a different Python version, consider creating a virtual environment with the appropriate one.
We provide all the scripts necessary to train and test the various architectures. Each script accepts many arguments and the best way for you to check which arguments you should use is to check the code of the script, as arguments are always found at the very top.
Nevertheless, we provide a few example commands to help you getting started
One key-feature of our work is modularity, we wrote each piece of this project such that we could easily combine different kinds of encoders and decoders, rather than having a few fixed models.
As an example, to train a reconstruction framework that uses the PointNet encoder, and a medium-sized fully-connected decoder, one might run:
python3 train_reconstruction.py --encoder=pointnet --decoder=fcm # leave the other arguments to their default value
python3 test_reconstruction.py --encoder=pointnet --decoder=fcm --checkpoint_path=...pth # specify the path of the .pth file generated by the previous script
python3 train_completion.py --model=dgpp # leave the other arguments to their default value
python3 test_completion.py --model=dgpp --checkpoint_path=...pth # specify the path of the .pth file generated by the previous script
python3 visualize_pointcloud.py --pointcloud_path=...pts # specify the path of the .pts file describing the pointcloud
python3 visualize_reconstruction.py --encoder=pointnet --decoder=fcm --pointcloud_path=...pts
Visualizing completion (partial pointcloud + completed pointcloud + original pointcloud, using different viewpoints for cropping)
python3 visualize_completion.py --model=dgpp --checkpoint_path=...pth --pointcloud_path=...pts