Skip to main content

ml_dl.draw_yolo_boxes

ml_dl.draw_yolo_boxes(ax, img, lbl_path, color='lime', linewidth=1.5)

Overlay YOLO-format bounding boxes from lbl_path onto img.

The label file is expected to be the standard YOLO format – one row per box: <class> <cx> <cy> <w> <h> with all coordinates normalised to [0, 1] relative to the image dimensions. Returns the number of boxes drawn (0 if the label file is missing or empty).