MCPcopy
hub / github.com/ZFTurbo/Weighted-Boxes-Fusion / show_boxes

Function show_boxes

example.py:27–40  ·  view source on GitHub ↗
(boxes_list, scores_list, labels_list, image_size=800)

Source from the content-addressed store, hash-verified

25
26
27def show_boxes(boxes_list, scores_list, labels_list, image_size=800):
28 thickness = 5
29 color_list = gen_color_list(len(boxes_list), len(np.unique(labels_list)))
30 image = np.zeros((image_size, image_size, 3), dtype=np.uint8)
31 image[...] = 255
32 for i in range(len(boxes_list)):
33 for j in range(len(boxes_list[i])):
34 x1 = int(image_size * boxes_list[i][j][0])
35 y1 = int(image_size * boxes_list[i][j][1])
36 x2 = int(image_size * boxes_list[i][j][2])
37 y2 = int(image_size * boxes_list[i][j][3])
38 lbl = labels_list[i][j]
39 cv2.rectangle(image, (x1, y1), (x2, y2), color_list[i][lbl], int(thickness * scores_list[i][j]))
40 show_image(image)
41
42
43def example_wbf_2_models(iou_thr=0.55, draw_image=True):

Callers 3

example_wbf_2_modelsFunction · 0.85
example_wbf_1_modelFunction · 0.85
example_nms_2_modelsFunction · 0.85

Calls 2

gen_color_listFunction · 0.85
show_imageFunction · 0.85

Tested by

no test coverage detected