Code to convert files in kitti tracking to kitti detection #58
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is useful if one has to use neural nets, designed for kitti object detection, for the kitti tracking dataset. The kitti tracking dataset has slight changes in the label files and the calib files. The label files in kitti detection have the following format and there is a separate label file for each image:
[name truncated occluded alpha 2dbbox_x1 2d_bbox_y1 2d_bbox_x2 2d_bbox_y2 3d_bbox_height 3d_bbox_width 3d_bbox_length 3d_bbox_x 3d_bbox_y 3d_bbox_z rot_y]
On the other hand, the kitti tracking dataset has only one label file for each folder and the format is:
[frame_num obj_id name truncated occluded alpha 2dbbox_x1 2d_bbox_y1 2d_bbox_x2 2d_bbox_y2 3d_bbox_height 3d_bbox_width 3d_bbox_length 3d_bbox_x 3d_bbox_y 3d_bbox_z rot_y]
Also, there is a difference in the calibration files as well. In the kitti object detection dataset, the calibration files have
Tr_velo_to_cam:, Tr_velo_to_imu: and R0_rect:
while the kitti tracking dataset hasTr_velo_cam, Tr_velo_imu and R_rect
. Furthermore, there is one calib file for each folder of images instead of having a separate calib file for each image as is the case in the kitti detection dataset.My code takes the files in each image folder in the kitti tracking dataset and converts them to the kitti object detection dataset. So, for example, for training image folder 0000 with 153 images, I take the label file and break it down into 153 label files (one for each image) and I create 153 copies of the calib file (with the necessary changes as well).