Skip to content

Instantly share code, notes, and snippets.

View RaulS963's full-sized avatar
😈
horny af

Silver RaulS963

😈
horny af
View GitHub Profile
@Tony607
Tony607 / yolo_non_max_suppression.py
Created March 25, 2018 01:22
Gentle guide on how YOLO Object Localization works with Keras (Part 2)
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