def draw_outputs(img, boxes, confidences, wait=1):
I = img * 255.0
#nms = non_max_suppression_fast(np.asarray(filtered_boxes), 1.00)
picks = postprocess_boxes(boxes, confidences)
for box, conf, top_label in picks:#[filtered[i] for i in picks]:
if top_label != classes:
#print("%f: %s %s" % (conf, coco.i2name[top_label], box))
c = colorsys.hsv_to_rgb(((top_label * 17) % 255) / 255.0, 1.0, 1.0)
c = tuple([255*c[i] for i in range(3)])
I = cv2.cvtColor(I.astype(np.uint8), cv2.COLOR_RGB2BGR)
cv2.imshow("outputs", I)
cv2.waitKey(wait)
评论列表
文章目录