Skip to content

Commit

Permalink
ObjectDetectionTask: increase test coverage for torchvision 0.14+ (#1739
Browse files Browse the repository at this point in the history
)

* 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 <[email protected]>
  • Loading branch information
isaaccorley and adamjstewart committed Mar 2, 2024
1 parent bae6988 commit d147be1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/trainers/test_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
Expand Down

0 comments on commit d147be1

Please sign in to comment.