Closed pengKiina closed 4 years ago
I'm doing something else now, so I'll check it after completion. :)
def draw_bboxes(image: np.ndarray, bboxes: np.ndarray, classes: dict):
"""
@parma image: Dim(height, width, channel)
@param bboxes: (candidates, 4) or (candidates, 5)
[[center_x, center_y, w, h, class_id], ...]
[[center_x, center_y, w, h, class_id, propability], ...]
@param classes: {0: 'person', 1: 'bicycle', 2: 'car', ...}
@return drawn_image
Usage:
image = media.draw_bboxes(image, bboxes, classes)
"""
classes = { class_id: label }
If you create classes
and make bbox + label + conf
to [x, y, w, h, label_id, conf]
, it seems to be what you want.
Thanks a lot.
it is a great work, could you add more parameters that would get the lib more applicable.
such as:
output_image = draw_bbox(img, bbox, label, conf)