In this project, we perform a detailed empirical study of 3d shape classification under few-shot setting using common 3D architectures, datasets and few-shot techniques.
- Python3
- Pytorch
- json
- Change directory to
./filelists/ModelNet40_voxels
- download and unzip ModelNet40.zip from (https://modelnet.cs.princeton.edu/)
- use utils/binvox_convert.py to convert this data to voxel format
- Change directory to
./filelists/ModelNet40_views
- download and unzip rendered images from (https://github.com/jongchyisu/mvcnn_pytorch)
- Change directory to
./filelists/ModelNet40_points
- download and unzip data from (https://github.com/yanx27/Pointnet_Pointnet2_pytorch)
- Require three data split json file: 'base.json', 'val.json', 'novel.json' for each dataset
- The format should follow
{"label_names": ["class0","class1",...], "image_names": ["filepath1","filepath2",...],"image_labels":[l1,l2,l3,...]} - See utils/create_json.ipynb on how to generate these files for ModelNet40 dataset. Update data_dir['DATASETNAME'] in configs.py.
In general, run
python ./train.py --dataset [DATASETNAME] --model [BACKBONENAME] --method [METHODNAME] [--OPTIONARG]
Specifically, below are some examples to run experiments on ModelNet40 dataset using different architectures and few-shot techniques:
- VoxNet:
python ./train.py --dataset modelnet40_voxels --method protonet --voxelized
- MVCNN:
python ./train.py --dataset modelnet40_views --model Conv4 --method maml --num_views 12
- PointNet:
python ./train.py --dataset modelnet40_points --method baseline --num_points 1024
Similarly, you can use other 3D datasets. Please refer to io_utils.py for additional options.
We have modified and built upon the following publicly available code:
- Few-shot Framework and Methods: https://github.com/wyharveychen/CloserLookFewShot
- VoxNet: https://github.com/dimatura/voxnet; https://github.com/MonteYang/VoxNet.pytorch; https://github.com/Ryanglambert/3d_model_retriever
- MVCNN: https://github.com/jongchyisu/mvcnn_pytorch; https://github.com/RBirkeland/MVCNN-PyTorch
- PointNet: https://github.com/charlesq34/pointnet; https://github.com/fxia22/pointnet.pytorch; https://github.com/yanx27/Pointnet_Pointnet2_pytorch