From d147be127973dddcf5d49e1885b6223cf5696c9b Mon Sep 17 00:00:00 2001 From: Isaac Corley <22203655+isaaccorley@users.noreply.github.com> Date: Sat, 25 Nov 2023 10:55:50 -0600 Subject: [PATCH] ObjectDetectionTask: increase test coverage for torchvision 0.14+ (#1739) * fix test coverage in trainers validation step * add tests for multilabelclassificationtask * Minimal bug fix for now * Simpler random code --------- Co-authored-by: Adam J. Stewart --- tests/trainers/test_detection.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/trainers/test_detection.py b/tests/trainers/test_detection.py index a05e1820dbf..8a6cfdc73fd 100644 --- a/tests/trainers/test_detection.py +++ b/tests/trainers/test_detection.py @@ -45,9 +45,12 @@ def forward(self, images: Any, targets: Any = None) -> Any: else: # eval mode output = [] for i in range(batch_size): + boxes = torch.rand(10, 4) + # xmax, ymax must be larger than xmin, ymin + boxes[:, 2:] += 1 output.append( { - "boxes": torch.rand(10, 4), + "boxes": boxes, "labels": torch.randint(0, 2, (10,)), "scores": torch.rand(10), }