How to Implement Your Own Datset Converter
Create Your Dataset Class
Inherit BaseDataFormat class
Implement some functions.
__init__()
Call _parse_annotation() and _parse_class_list()
Create MSCOCODataset() instance.
_parse_annotation()
Implement annotation parser and set self.image_id_to_image_info and self.image_id_to_annotation_list .
self .image_id_to_image_info [IMAGE_ID ] = {
"file_name" : IMAGE_FILE_NAME ,
"file_path" : IMAGE_FILE_PATH ,
"width" : IMAGE_WIDTH ,
"height" : IMAGE_HEIGHT ,
}
self .image_id_to_annotation_list [IMAGE_ID ].append ({
"annotation_id" : ANNOTATION_ID ,
"class_id" : CLASS_ID ,
"bbox" : BBOX , # Absolute points [left, top, width, height]
"score" : SCORE or None , # If exists, otherwise None
})
_parse_class_list()
Implement class list parser and set self.class_id_to_class_name and self.class_name_to_class_id .
convert()
Refer to YOLO class
validation_check()
Refer to YOLO class
Add Supporting Dataset Format
Add your own dataset format name to the programs.