Contents
  1. Environment Setup
  2. Prepare the Dataset

I haven’t gotten PVNet running yet, so I’m setting it aside for now.

Title: PVNet: Pixel-Wise Voting Network for 6DoF Pose Estimation Authors: Zhejiang University Conference: CVPR Year: 2018 Code: https://zju3dv.github.io/pvnet/

Environment Setup

(1) Create a virtual environment

Create a conda environment

conda create -n pvnet python=3.7
conda activate pvnet

conda install pytorch==1.8.0 torchvision==0.9.0 torchaudio==0.8.0 cudatoolkit=11.1 -c pytorch -c conda-forge

pip install Cython==0.28.2
sudo apt-get install libglfw3-dev libglfw3

In requirement.txt, comment out the version pins for numpy and ipdb, then

pip install -r requirements.txt

(2) Compile extensions

Create environment variables

export CUDA_HOME="/usr/local/cuda-11.6"
cd lib/cscr

Compile ransac_voting

cd ransac_voting
python setup.py build_ext --inplace

Compile nn

cd ../nn
python setup.py build_ext --inplace

Compile fps

cd ../fps
python setup.py build_ext --inplace

Prepare the Dataset

Use Objectdatasettools to create the dataset and organize it in the following format:

For a reference of the prepared files, see this file

├── /path/to/dataset
│   ├── model.ply
│   ├── camera.txt
│   ├── diameter.txt  // the object diameter, whose unit is meter
│   ├── rgb/
│   │   ├── 0.jpg
│   │   ├── ...
│   │   ├── 1234.jpg
│   │   ├── ...
│   ├── mask/
│   │   ├── 0.png
│   │   ├── ...
│   │   ├── 1234.png
│   │   ├── ...
│   ├── pose/
│   │   ├── pose0.npy
│   │   ├── ...
│   │   ├── pose1234.npy
│   │   ├── ...
│   │   └──

Create a symbolic link

ln -s /path/to/custom_dataset data/custom

Process the dataset

python run.py --type custom

If you encounter ValueError: shapes (8,4) and (3,3) not aligned: 4 (dim 1) != 3 (dim 0) Modify line 23 in lib/utils/base_utils as follows xyz = np.dot(xyz, RT[:3, :3].T) + RT[:3, 3:].T