This is a Pytorch implementation of Detectaion part of Class-Level Confidence Based 3D Semi-Supervised Learning.
Paper link: https://arxiv.org/abs/2210.10138
Preparation: A Ubuntu system with GPU.
Install Nvidia driver and CUDA Toolkit.
$ nvidia-smi # check driver
$ nvcc --version # check toolkit
Install Python -- This repo is tested with Python 3.7.6.
Install NumPy -- This repo is tested with NumPy 1.18.5. Please make sure your NumPy version is at least 1.18.
Install PyTorch with CUDA -- This repo is tested with
PyTorch 1.5.1, CUDA 10.1. It may work with newer versions,
but that is not guaranteed. A lower version may be problematic.
pip install torch==1.5.1 torchvision==0.6.1
or
conda install pytorch==1.5.1 torchvision==0.6.1 cudatoolkit=10.1 -c pytorch
Install TensorFlow (for TensorBoard) -- This repo is tested with TensorFlow 2.2.0.
Compile the CUDA code for PointNet++, which is used in the backbone network:
cd pointnet2
python setup.py install
If there is a problem, please refer to Pointnet2/Pointnet++ PyTorch
Compile the CUDA code for general 3D IoU calculation in OpenPCDet:
cd OpenPCDet
python setup.py develop
I deleted the CUDA kernels except 3D IoU calculation in OpenPCDet for faster installation.
Install dependencies:
pip install -r requirements.txt
Preparation: GPU support CUDA 10.2, not use GeForce 30 series with Ampere micro-architecture, anaconda is recommended.
> nvidia-smi # check nvidia driver
> nvcc --version # check CUDA Toolkit version
> cl # check MSVC compiler, if no, add compile to environment path
- create a virtual environment:
conda create --name iou python=3.7 - install
numpy:conda install numpy -y - install
pytorchandcudatoolkit:conda install pytorch==1.5.1 torchvision==0.6.1 cudatoolkit=10.2 -c pytorch - degrade setuptools:
pip install setuptools=59.6 - install
pointnet2:cd pointnet2; python ./setup.py install - install
OpenPCDet:cd OpenPCDet; python ./setup.py develop - install
tensorflow:pip install tensorflow - install
requirements:pip install -r ./requirements.txt
Please follow the instructions in scannet/README.md. using the download script with
-o $(pwd) --types _vh_clean_2.ply .aggregation.json _vh_clean_2.0.010000.segs.json .txt options to download data.
Please follow the instructions in sunrgbd/README.md.
Please run:
sh run_pretrain_ori.sh <GPU_ID> <LOG_DIR> <DATASET> <LABELED_LIST>For example:
sh run_pretrain_ori.sh 0 pretrain_scannet scannet scannetv2_train_0.1.txtsh run_pretrain_ori.sh 0 pretrain_sunrgbd sunrgbd sunrgbd_v1_train_0.05.txtPlease run:
sh run_pretrain.sh <GPU_ID> <LOG_DIR> <DATASET> <LABELED_LIST> <PRETRAIN_CKPT>For example:
sh run_pretrain.sh 0 pretrain_scannet scannet scannetv2_train_0.1.txt ckpts/scan_0.1_pretrain_ori.tarsh run_pretrain.sh 0 pretrain_sunrgbd sunrgbd sunrgbd_v1_train_0.05.txt ckpts/sun_0.05_pretrain_ori.tar
Please run:
```shell script
sh run_train.sh <GPU_ID> <LOG_DIR> <DATASET> <LABELED_LIST> <PRETRAIN_CKPT>
For example, use the downloaded models:
sh run_train.sh 0 train_scannet scannet scannetv2_train_0.1.txt ckpts/scan_0.1_pretrain.tarsh run_train.sh 0 train_sunrgbd sunrgbd sunrgbd_v1_train_0.05.txt ckpts/sun_0.05_pretrain.tarYou may modify the script by adding --view_stats to load labels on unlabeled data and view the statistics on the unlabeled data (e.g. average IoU, class prediction accuracy).
Please run:
sh run_eval.sh <GPU_ID> <LOG_DIR> <DATASET> <LABELED_LIST> <CKPT>For example, use the downloaded models:
sh run_eval.sh 0 eval_scannet scannet scannetv2_train_0.1.txt ckpts/scan_0.1.tarsh run_eval.sh 0 eval_sunrgbd sunrgbd sunrgbd_v1_train_0.05.txt ckpts/sun_0.05.tar