This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def yolo_non_max_suppression(scores, boxes, classes, max_boxes = 10, iou_threshold = 0.5): | |
""" | |
Applies Non-max suppression (NMS) to set of boxes | |
Arguments: | |
scores -- tensor of shape (None,), output of yolo_filter_boxes() | |
boxes -- tensor of shape (None, 4), output of yolo_filter_boxes() that have been scaled to the image size (see later) | |
classes -- tensor of shape (None,), output of yolo_filter_boxes() | |
max_boxes -- integer, maximum number of predicted boxes you'd like | |
iou_threshold -- real value, "intersection over union" threshold used for NMS filtering |