Skip to content

[Bug-fix] prevent eval() from crashing in the case of an image with no annotations#405

Open
RihaanBH-1810 wants to merge 1 commit intoJdeRobot:masterfrom
RihaanBH-1810:bugfix-eval-crashing-when-no-annotations
Open

[Bug-fix] prevent eval() from crashing in the case of an image with no annotations#405
RihaanBH-1810 wants to merge 1 commit intoJdeRobot:masterfrom
RihaanBH-1810:bugfix-eval-crashing-when-no-annotations

Conversation

@RihaanBH-1810
Copy link

This simple PR fixes #404
In perceptionmetrics/models/torch_detection.py, if len(boxes) == 0, we now convert boxes to an empty tensor of shape (0, 4) with float32 dtype before wrapping it as tv_tensors.BoundingBoxes thereby preventing mismatch during eval().

Before the fix :
Screenshot from 2026-03-05 03-27-43

After applying fix :
image

@dpascualhe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] eval() crashes when an image in the dataset has zero annotations.

1 participant