This repository is for our IROS 2020 paper "PC-NBV: A Point Cloud Based Deep Network for Efficient Next Best View Planning". The code is modified from pcn and PU-GAN.
This repository is based on Tensorflow and the TF operators from PointNet++. Therefore, you need to install tensorflow and compile the TF operators.
For installing tensorflow, please follow the official instructions in here. The code is tested under:
- Tensorflow 1.12, Python 3.7, Ubuntu 16.04.
- Tensorflow 1.15(with gpu), Python 3.6, Ubuntu 18.04.
For compiling TF operators, please check tf_xxx_compile.sh
under each op subfolder in tf_ops
folder. Note that you need to update nvcc
, python
and tensoflow include library
if necessary.
When running the code, if you have undefined symbol: _ZTIN10tensorflow8OpKernelE
error, you need to compile the TF operators. If you have already added the -I$TF_INC/external/nsync/public -L$TF_LIB -ltensorflow_framework
but still have cannot find -ltensorflow_framework
error. Please use 'locate tensorflow_framework' to locate the tensorflow_framework library and make sure this path is in $TF_LIB
.
-
Setting up the Environment
conda create -n "pc-nbv" python=3.6 ipython conda activate pc-nbv pip install -r requirements.txt
-
Clone the repository:
https://github.com/Smile2020/PC-NBV.git cd PC-NBV
-
Compile the TF operators:
Follow the above information to compile the TF operators.
-
Generate the data:
To generate your own data from ShapeNet, first Download ShapeNetCore.v1. Then, create partial point clouds from depth images (see instructions in
render
) and corresponding ground truths by sampling from CAD models (sample code).You can generate networks' inputs and supervision npy data using generate_nbv_data.py, then use lmdb_write_shapenet.py to make lmdb data.
-
Train the model:
python train.py
-
Evaluate the model:
To test your trained model, you can run:
python test.py --checkpoint model_path
Please contact 'zengr17@mails.tsinghua.edu.cn'