YoloParser#

class YoloParser[source]#

Parses input images and labels in the YOLO format.

Parameters
category_listlist of str or dict

List of categories or dictionary mapping category id to category name

__init__(category_list: Optional[Union[Sequence, str, dict]] = ('person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus', 'train', 'truck', 'boat', 'traffic light', 'fire hydrant', 'stop sign', 'parking meter', 'bench', 'bird', 'cat', 'dog', 'horse', 'sheep', 'cow', 'elephant', 'bear', 'zebra', 'giraffe', 'backpack', 'umbrella', 'handbag', 'tie', 'suitcase', 'frisbee', 'skis', 'snowboard', 'sports ball', 'kite', 'baseball bat', 'baseball glove', 'skateboard', 'surfboard', 'tennis racket', 'bottle', 'wine glass', 'cup', 'fork', 'knife', 'spoon', 'bowl', 'banana', 'apple', 'sandwich', 'orange', 'broccoli', 'carrot', 'hot dog', 'pizza', 'donut', 'cake', 'chair', 'couch', 'potted plant', 'bed', 'dining table', 'toilet', 'tv', 'laptop', 'mouse', 'remote', 'keyboard', 'cell phone', 'microwave', 'oven', 'toaster', 'sink', 'refrigerator', 'book', 'clock', 'vase', 'scissors', 'teddy bear', 'hair drier', 'toothbrush'))[source]#
__new__(*args, **kwargs)#

Methods

YoloParser.parse_images_and_labels(...)

We assume image and labels are correlated, meaning equivalent directories with matching image and label names.

YoloParser.parse_label_file(full_label_path)

Parse a single label file.

YoloParser.parse_yolo_dir(yolo_path)

Create COCO dataset from a directory containing images and labels in the YOLO format.

YoloParser.save_coco_json(output_path)

Save the COCO dataset to a JSON file.