-
Notifications
You must be signed in to change notification settings - Fork 218
Open
Description
for index, detection in enumerate(detections):
for new_detection in new_detections:
if overlapping_area(detection, new_detection) > threshold:
del detections[index]
break
else:
new_detections.append(detection)
del detections[index]
changes to iterator will not work - nms produces:
detections = [[10, 10, .12, 10, 10], [50, 50, .8,10, 10], [100, 100, 0.9, 10, 10]]
print ("Detections before NMS = {}".format(detections))
print ("Detections after NMS = {}".format(nms(detections)))
Detections before NMS = [[10, 10, 0.12, 10, 10], [50, 50, 0.8, 10, 10], [100, 100, 0.9, 10, 10]]
Detections after NMS = [[100, 100, 0.9, 10, 10], [50, 50, 0.8, 10, 10]]
e.g. change to:
while len(detections) > 0:
detection = detections.pop()
for new_detection in new_detections:
if overlapping_area(detection, new_detection) > threshold:
break
else:
new_detections.append(detection)
detections = [[10, 10, .12, 10, 10], [50, 50, .8,10, 10], [100, 100, 0.9, 10, 10]]
print ("Detections before NMS = {}".format(detections))
print ("Detections after NMS = {}".format(nms(detections)))
Detections before NMS = [[10, 10, 0.12, 10, 10], [50, 50, 0.8, 10, 10], [100, 100, 0.9, 10, 10]]
Detections after NMS = [[100, 100, 0.9, 10, 10], [10, 10, 0.12, 10, 10], [50, 50, 0.8, 10, 10]]
Metadata
Metadata
Assignees
Labels
No labels