Annotation format conversions
Detectron2 has its data description built based on the COCO annotation format. In other words, it supports registering datasets using the COCO data annotation format. However, other data annotation formats are abundant, and you may download a dataset or use a labeling tool that supports another data format different from COCO. Therefore, this section covers the code snippets used to convert data from the popular Pascal VOC and YOLO formats to COCO style.
Important note
A statement that starts with an exclamation mark (!
) means it is a Bash command to be executed in a Jupyter notebook (Google Colab) code cell. If you want to run it in a terminal, you can safely remove this exclamation mark and execute this statement.
By understanding the different data formats as described, it is relatively easy to write code to convert data from one format to another. However, this section uses the pylabel
package to perform this conversion to speed up the development...