This repository holds the YoloToKitti. A simple code to convert Yolo detection files to Kitti files.
- Yolo format: (int_label, x_center, y_center, width, height) - float values relative to width and height of image, it can be equal from (0.0 to 1.0].
- Kitti format: (str_label, x1, y1, x2, y2) - "real" bounding box values.
The main dependency to run the code is
The codebase is written in Python 3.6. We recommend the Anaconda Python distribution.
Use git to clone this repository
git clone --recursive https://github.com/carloscaetano/YoloToKitti
To convert the Yolo format detection files to Kitti format, run the YolloToKitti.py. It has two arguments:
- [--detections, -d] Directory containing the Yolo detection files (.txt)
- [--images, -i] Directory containing the corresponding image files (.jpg)
- [--output, -o] Directory to save the converted Kitti detection files (.txt)
To convert the Yolo detection files, at the example directory ./yoloV4_detections, with the corresponding image files at ./images and save the converted Kitti detection files to the folder ./files_converted, you can run
python YolloToKitti.py --detections ./yoloV4_detections --images ./images --output ./files_converted
or
python YolloToKitti.py -d ./yoloV4_detections -i ./images -o ./files_converted
[back to top)]
For any question, please contact
Carlos Caetano: carlos.caetano@dcc.ufmg.br