This file contains 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
import torch | |
# Original author: Francisco Massa: | |
# https://github.com/fmassa/object-detection.torch | |
# Ported to PyTorch by Max deGroot (02/01/2017) | |
def nms(boxes, scores, overlap=0.5, top_k=200): | |
"""Apply non-maximum suppression at test time to avoid detecting too many | |
overlapping bounding boxes for a given object. | |
Args: | |
boxes: (tensor) The location preds for the img, Shape: [num_priors,4]. |