Nms optimize for stationary cars (#9684)

* Use different nms values for different object types

* Add tests

* Format tests
This commit is contained in:
Nicolas Mowen
2024-02-05 16:52:06 -07:00
committed by GitHub
parent 97a619eaf0
commit 50563eef8d
3 changed files with 23 additions and 2 deletions

View File

@@ -287,6 +287,15 @@ class TestObjectBoundingBoxes(unittest.TestCase):
consolidated_detections = reduce_detections(frame_shape, detections)
assert len(consolidated_detections) == len(detections)
def test_vert_stacked_cars_not_reduced(self):
detections = [
("car", 0.8, (954, 312, 1247, 475), 498512, 1.48, (800, 200, 1400, 600)),
("car", 0.85, (970, 380, 1273, 610), 698752, 1.56, (800, 200, 1400, 700)),
]
frame_shape = (720, 1280)
consolidated_detections = reduce_detections(frame_shape, detections)
assert len(consolidated_detections) == len(detections)
class TestRegionGrid(unittest.TestCase):
def setUp(self) -> None: