original github: https://github.com/epiception/CalibNet
original paper: CalibNet: Self-Supervised Extrinsic Calibration using 3D Spatial Transformer Networks
Many thanks to otaheri for providing the CUDA implementation of chamfer distance
otaheri/chamfer_distance.
Windows 10 / Ubuntu 18.04 / Ubuntu 20.04
Pytorch >= 1.8
CUDA 11.1
Python >= 3.8
conda create -n <env_name> python=3.8
conda activate <env_name>
Please note that a more recent pytorch is likely compatatible with our codes. If you did not install pytorch before, you can try the following command.
conda install pytorch==1.8.0 torchvision==0.9.0 torchaudio==0.8.0 cudatoolkit=11.1 -c pytorch -c conda-forge
pip3 install -r requirements.txt
KITTI Odometry (You may need to register first to acquire access)
Dataset Should be organized into data/
filefolder in our root:
/PATH/TO/CalibNet_pytorch/
--|data/
--|poses/
--|00.txt
--|01.txt
--...
--|sequences/
--|00/
--|image_2/
--|image_3/
--|velodyne/
--|calib.txt
--|times.txt
--|01/
--|02/
--...
--...
Use demo.py to check your data.
The following command is fit with a 12GB GPU.
python train.py --batch_size=8 --epoch=100 --inner_iter=1 --pcd_sample=4096 --name=cam2_oneiter --skip_frame=10
python test.py --inner_iter=1 --pretrained=./checkpoint/cam2_oneiter_best.pth --skip_frame=1 --pcd_sample=-1
Download pretrained cam2_oneiter_best.pth
from here and put it into root/checkpoint/
.
pcd_sample=-1
means input the whole point cloud (but random permuted). However, you need to keep batch_size=1
accordingly, or it may cause collation error for dataloader.
Relevant training logs can be found in log dir.
Rotation (deg) X:3.0023,Y:2.9971,Z:3.0498
Translation (m): X:0.0700,Y:0.0673,Z:0.0862
see config.yml
for dataset setting.
dataset:
train: [0,1,2,3,4,5,6,7]
val: [8,9,10]
test: [11,12,13]
cam_id: 2 # (2 or 3)
pooling: 3 # max pooling of semi-dense image, must be odd
KITTI Odometry has 22 sequences, and you need to split them into three categories for training, validation and testing in config.yml
.
cam_id=2
represents left color image dataset and cam_id=3
represents the right.
set pooling
paramter (only support odd numbers) to change max pooling of preprocessing for depth map.