(boxes_list, scores_list, labels_list, image_size=800)
| 25 | |
| 26 | |
| 27 | def 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 | |
| 43 | def example_wbf_2_models(iou_thr=0.55, draw_image=True): |
no test coverage detected