mmdetection3D series--(2) data set preparation

1 Introduction

    After running the demo, do you want to experience the process of training and testing yourself? However, all of this is based on the data set. Only with data can we train, and with data can we test. So, today, record the processing of the dataset.

2. Datasets supported by mmdetection3d

    mmdetection3d supports many datasets, such as kitti, NuScenes, waymo, Lyft, S3DIS, ScanNet and SUN RGB-D. Here you have to choose the corresponding data set according to your own task, whether it is for 2d/3d detection or segmentation, it is not the same. However, due to the different formats and rules of these data, it is likely to cause trouble, so mmdetection has prepared some scripts to convert the downloaded data into a format that the training/test script can recognize. In order to carry out subsequent work on this data set.

    Here we take the more kitti data set as an example to show you how to convert it (other data sets are also basically the same).

A brief introduction to the KITTI dataset:

    The KITTI dataset is jointly established by the Karlsruhe Institute of Technology in Germany and the Toyota American Institute of Technology. It is currently the largest computer vision algorithm evaluation dataset in the autonomous driving scenario in the world. The author collected up to 6 hours of real traffic environment. The data set consists of corrected and synchronized images, radar scans, high-precision GPS information and IMU acceleration information and other modal information. This data set is used to evaluate the performance of computer vision technologies such as stereo image (stereo), optical flow (optical flow), visual odometry (visual odometry), 3D object detection and 3D tracking (tracking) in the vehicle environment . The 3D object detection dataset consists of 7481 training images and 7518 testing images with corresponding point cloud data, including a total of 80256 labeled objects. Specifically, the blue box in the figure below marks the data we need, which are:

    1. Color image data (12GB)
    2. Point cloud data (29GB)
   3. Camera correction data (16MB)
    4. Label data (5MB)

    Among them, the color image data, point cloud data, and camera correction data all include two parts: training (7481) and testing (7518), and the label data only has the training part.

data conversion

    The conversion process is generally divided into two steps, 1. Download the original data and divide the folders as required; 2. Run the corresponding script.

(1). Download the original data and divide the folders as required

    The download address of the kitti dataset is below:

 KITTI dataset download link

   After downloading and decompressing, create a new folder to store kitti data: the structure is as follows, just put the corresponding data in the corresponding folder. The difference is that kitti raw data is first divided into sensors and then divided into training tests, while mmdetection3d is divided into training tests first and then divided into sensors:

mmdetection3d
├── data
│   ├── kitti
│   │   ├── ImageSets
│   │   ├── testing
│   │   │   ├── calib
│   │   │   ├── image_2
│   │   │   ├── velodyne
│   │   ├── training
│   │   │   ├── calib
│   │   │   ├── image_2
│   │   │   ├── label_2
│   │   │   ├── velodyne

Then download the things in the imageset, that is, the files that divide the data (run under the mmdetection3d folder)

# 下载数据划分文件
wget -c  https://raw.githubusercontent.com/traveller59/second.pytorch/master/second/data/ImageSets/test.txt --no-check-certificate --content-disposition -O ./data/kitti/ImageSets/test.txt
wget -c  https://raw.githubusercontent.com/traveller59/second.pytorch/master/second/data/ImageSets/train.txt --no-check-certificate --content-disposition -O ./data/kitti/ImageSets/train.txt
wget -c  https://raw.githubusercontent.com/traveller59/second.pytorch/master/second/data/ImageSets/val.txt --no-check-certificate --content-disposition -O ./data/kitti/ImageSets/val.txt
wget -c  https://raw.githubusercontent.com/traveller59/second.pytorch/master/second/data/ImageSets/trainval.txt --no-check-certificate --content-disposition -O ./data/kitti/ImageSets/trainval.txt

(2). Run the corresponding script

Finally, run the conversion script: the input and output folders are the default

python tools/create_data.py kitti --root-path ./data/kitti --out-dir ./data/kitti

After the conversion is complete, the folder becomes like this:

kitti
├── ImageSets
│   ├── test.txt
│   ├── train.txt
│   ├── trainval.txt
│   ├── val.txt
├── testing
│   ├── calib
│   ├── image_2
│   ├── velodyne
│   ├── velodyne_reduced
├── training
│   ├── calib
│   ├── image_2
│   ├── label_2
│   ├── velodyne
│   ├── velodyne_reduced
│   ├── planes (optional)
├── kitti_gt_database
│   ├── xxxxx.bin
├── kitti_infos_train.pkl
├── kitti_infos_val.pkl
├── kitti_dbinfos_train.pkl
├── kitti_infos_test.pkl
├── kitti_infos_trainval.pkl
├── kitti_infos_train_mono3d.coco.json
├── kitti_infos_trainval_mono3d.coco.json
├── kitti_infos_test_mono3d.coco.json
├── kitti_infos_val_mono3d.coco.json

 At this point, the data required for training and testing is ready. If you need other data sets, you can refer to the official documentation: mmdetection3d official documentation

Guess you like

Origin blog.csdn.net/qq_45783225/article/details/129324814