End-to-end Pseudo-LiDAR for Image-Based 3D Object Detection 是发表在CVPR2020的单目目标检测模型,它通过对双目摄像头图片进行深度估计,然后将深度图从image view转换成欧氏空间,再通过现成的3D目标检测模型进行检测。
一些细节:
训练环境安装
对应Github Repo如下:https://github.com/mileyan/pseudo-LiDAR_e2e,作者选取了两个对于点云特征采取不同提取方式的目标检测网络来测试,这里我们采用PointRCNN来讲解训练环境的搭建。主要参考两个repo (1) mileyan/Pseudo_Lidar_V2,需要注意的是,虽然在pseudo-LiDAR_e2e中作者说KITTI数据的存放方式和Pseudo_Lidar_V2一样,但实际中并非如此,这一点下面会详细说。另一方面,我们需要使用Pseudo_Lidar_V2的代码来生成depth map(2)sshaoshuai/PointRCNN,PointRCNN中使用的是CUDA9.0,但如果照搬到pseudo-LiDAR_e2e中出导致很多问题的出现,尤其对于RTX系列的GPU。在pseudo-LiDAR_e2e中,作者使用了TITAN RTX GPU,说明CUDA版本大于等于10.0。
以下是环境建立的具体步骤:
PointRCNN
|-- data
| |-- KITTI
| | |-- ImageSets
| | |-- object
| | | |-- training
| | | |-- calib & velodyne & image_2 & image_3 & label_2
| | | |-- testing
| | | |-- calib & velodyne & image_2 & image_3
python ./src/preprocess/generate_depth_map.py --data_path <path-to-KITTI> --split_file ./split/trainval.txt
THCudaCheck FAIL file=/pytorch/aten/src/THC/THCGeneral.cpp line=383 error=11 : invalid argument
在以下网页下载对应的wheel代码,https://download.pytorch.org/whl/torch_stable.html
此处我使用python3.6和CUDA10.0的wheel
wget https://download.pytorch.org/whl/cu100/torch-1.1.0-cp36-cp36m-linux_x86_64.whl
wget https://download.pytorch.org/whl/cu100/torchvision-0.3.0-cp36-cp36m-linux_x86_64.whl
docker pull ufoym/deepo:py36-cu100
docker run --gpus 'device=6' -p 12222:22 -it --name=lbaiPrcnn --mount type=bind,source=/mnt/VOL_5/name/,target=/name ufoym/deepo:py36-cu100 bash
python -m pip install torch-1.1.0-cp36-cp36m-linux_x86_64.whl
python -m pip install torchvision-0.3.0-cp36-cp36m-linux_x86_64.whl
pip install easydict tqdm tensorboardX fire scikit-image numba torch-scatter==1.3.1 ipdb
运行pseudo-LiDAR_e2e/PointRCNN下的build_and_install.sh来安装所需的库
使用ln -s建立软链接来使用KITTI数据集
(可选)设置ssh
apt install openssh-server
编辑文件*/etc/ssh/sshd_config*,修改文件中的以下三行
PermitRootLogin yes # 可以登录 root 用户
PubkeyAuthentication yes # 可以使用 ssh 公钥许可
AuthorizedKeysFile .ssh/authorized_keys # 公钥信息保存到该文件中
重启sshd
/etc/init.d/ssh restart
python train_rcnn_depth.py --gt_database "" --cfg_file cfgs/e2e.yaml --batch_size 1 --train_mode end2end --ckpt_save_interval 1 --epochs 10 --mgpus --finetune
下一步
我将使用作者提供的pre-trained的SDN模型来重新训练,看是否可以得到和论文中近似的结果。
几个疑问
作者在Section4.2的第一段中提到,这个网络的训练方法是先训练stereo depth estimation network (SDN),然后固定这个depth network,并从头训练3D object detector。最后再使用balanced loss weights来joint train这两部分。其中,depth correction部分在Pseudo_Lidar_V2中有叙述。