Merge 86174b03fa0dfa3c441d1207644baf8a4c29b3b6 into b2564c1b011b34cebf7a5d39b5c5d986fea8979c
This commit is contained in:
commit
52f27bbaa8
@ -182,7 +182,6 @@ def yolov5_post_process(input_data):
|
||||
|
||||
def draw(image, boxes, scores, classes):
|
||||
"""Draw the boxes on the image.
|
||||
|
||||
# Argument:
|
||||
image: original image.
|
||||
boxes: ndarray, boxes of objects.
|
||||
@ -191,17 +190,17 @@ def draw(image, boxes, scores, classes):
|
||||
all_classes: all classes name.
|
||||
"""
|
||||
for box, score, cl in zip(boxes, scores, classes):
|
||||
top, left, right, bottom = box
|
||||
left, top, right, bottom = box
|
||||
print('class: {}, score: {}'.format(CLASSES[cl], score))
|
||||
print('box coordinate left,top,right,down: [{}, {}, {}, {}]'.format(top, left, right, bottom))
|
||||
top = int(top)
|
||||
print('box coordinate left,top,right,bottom: [{}, {}, {}, {}]'.format(left, top, right, bottom))
|
||||
left = int(left)
|
||||
top = int(top)
|
||||
right = int(right)
|
||||
bottom = int(bottom)
|
||||
|
||||
cv2.rectangle(image, (top, left), (right, bottom), (255, 0, 0), 2)
|
||||
cv2.rectangle(image, (left, top), (right, bottom), (255, 0, 0), 2)
|
||||
cv2.putText(image, '{0} {1:.2f}'.format(CLASSES[cl], score),
|
||||
(top, left - 6),
|
||||
(left, top - 6),
|
||||
cv2.FONT_HERSHEY_SIMPLEX,
|
||||
0.6, (0, 0, 255), 2)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user