源码链接https://gitee.com/luogyu/liu-qingzhen_nutonomy_pointpillars
原码(https://github.com/nutonomy/second.pytorch) 中缺少 nms.so 文件 ,不过此类问题可以通过 该问题解决方式解决,但我没有继续尝试。链接地址:https://github.com/traveller59/second.pytorch/issues/69
步骤1, git clone 命令下载到本地目录 。
按照ReadMe 文件执行 环境配置操作。
依次是
conda create -n pointpillars python=3.7 anaconda source activate pointpillars conda install shapely pybind11 protobuf scikit-image numba pillow conda install pytorch torchvision -c pytorch conda install google-sparsehash -c bioconda
pip install --upgrade pip pip install fire tensorboardX
git clone git@github.com:facebookresearch/SparseConvNet.git cd SparseConvNet/ bash build.sh # NOTE: if bash build.sh fails, try bash develop.sh instead
Add second.pytorch/ to your PYTHONPATH.
. Dataset preparation
Download KITTI dataset and create some directories first:
└── KITTI_DATASET_ROOT
├── training <-- 7481 train data
| ├── image_2 <-- for visualization
| ├── calib
| ├── label_2
| ├── velodyne
| └── velodyne_reduced <-- empty directory
└── testing <-- 7580 test data
├── image_2 <-- for visualization
├── calib
├── velodyne
└── velodyne_reduced <-- empty directory
Note: PointPillar's protos use KITTI_DATASET_ROOT=/data/sets/kitti_second/
.
2. Create kitti infos:
python create_data.py create_kitti_info_file --data_path=KITTI_DATASET_ROOT
3. Create reduced point cloud:
python create_data.py create_reduced_point_cloud --data_path=KITTI_DATASET_ROOT
4. Create groundtruth-database infos:
python create_data.py create_groundtruth_database --data_path=KITTI_DATASET_ROOT
5. Modify config file
The config file needs to be edited to point to the above datasets:
train_input_reader: { ... database_sampler { database_info_path: "/path/to/kitti_dbinfos_train.pkl" ... } kitti_info_path: "/path/to/kitti_infos_train.pkl" kitti_root_path: "KITTI_DATASET_ROOT" } ... eval_input_reader: { ... kitti_info_path: "/path/to/kitti_infos_val.pkl" kitti_root_path: "KITTI_DATASET_ROOT" }
这里是自己已经编辑好的 .proto目录
训练:
cd ~/second.pytorch/second python ./pytorch/train.py train --config_path=./configs/pointpillars/car/xyres_16.proto --model_dir=/path/to/model_dir
评估:
cd ~/second.pytorch/second/ python pytorch/train.py evaluate --config_path= configs/pointpillars/car/xyres_16.proto --model_dir=/path/to/model_dir
OVER:
FINE.