Dataset: ModelNet40, The UoY 3D Face Dataset
This work is based on hxdengBerkeley's PointCNN.Pytorch. A Pytorch implementation of PointCNN.
The UoY 3D Face Dataset was used to test the PointCNN's performance of matching facial masks to faces. The data in this dataset has been manually preprocessed and labelled. Preprocessing includes aligning nose area of each face to the same location. This facilitates the later automatic labelling.
Many improvements have been done to increase the GPU efficiency (was 95% of the time at 0% on GPU but CPU was consistantly busy) and significantly speed up the training process. Most of the calculations in model have been move to GPU but they can still be switched back to CPU. When training on ModelNet40 Dataset, a minimum of 3.5Gb GPU MEM are expected. While there are some CPU compulsory calculations, the overall GPU efficiency is around 85%.
- Move a majority of computational workload to GPU from CPU
- Rewrite the self-defined data loader to
torch.utils.data.Datasetandtorch.utils.data.Dataloader - Add
adamas an alternative optimizer - Add generating and saving plot of train/test accuracy and train loss
- Add UoY
- Adjustable train set size (randomly select data but considering distribution over classes)(Under implementation)
This project relies on a variety of packages. To make the environment building-up process more straightforward, a configuration file, xconv_conda_env_setup.yml, is provided. It is recommended to use Anaconda to install the environment.
For getting and installing Anaconda, Please visit Anaconda's official website to download and install the Anaconda on your devices.
If you already have the ENV set up, simply jump over step 2.
cdto the project directory (wherexconv_conda_env_setup.ymlis located at)- In your terminal, use
conda create --name env_name --file xconv_conda_env_setup.yml. Replaceenv_nameto your desired environment name. - In your terminal, use
conda activate env_nameto switch to this environment. - Prepare data according to yangyanli/PointCNN (Modelnet40)
- In your terminal, use
python train_pytorch_modelnet40.pyto start training. There are multiple commandline arguments acceptable. (runpython train_pytorch_dataloader.pyfor preprocessed UoY dataset) - Have fun
After preprocessing on UoY dataset, there are 250 faces remain in the dataset. 10 of them were randomly picked up as the standards for generating 10 labels. The result is shown in the graph below.
