Skip to content

Commit

Permalink
fix failing unittests
Browse files Browse the repository at this point in the history
  • Loading branch information
tobias-kupek-swarm committed Nov 24, 2021
1 parent ee16652 commit ff78b44
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torchmetrics/detection/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ def _get_coco_format(
annotation_id = 1 # has to start with 1, otherwise COCOEval results are wrong

boxes = [
box_convert(box, in_fmt="xyxy", out_fmt="xywh") if box.size() == torch.Size([1, 4]) else box
box_convert(box, in_fmt="xyxy", out_fmt="xywh") if box.ndim > 1 and box.size(1) == 4 else box
for box in boxes
]
for image_id, (image_boxes, image_labels) in enumerate(zip(boxes, labels)):
Expand Down

0 comments on commit ff78b44

Please sign in to comment.