Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

object detection validation skips batches #90

Open
DaniAffCH opened this issue May 13, 2024 · 0 comments
Open

object detection validation skips batches #90

DaniAffCH opened this issue May 13, 2024 · 0 comments

Comments

@DaniAffCH
Copy link

DaniAffCH commented May 13, 2024

Describe the bug

for i in range(len(batch["batch_idx"])):

In this line, the index iterates through the tensor length, this could cause an erroneous metric computation, especially when the number of classes is reduced.

Indeed right after, you use the i to filter the bounding boxes.

for b in range(len(batch_bboxes_xyxy[batch["batch_idx"] == i, :])):

For instance, consider batch["batch_idx"] to be [0, 0, 0, 10]

in such case, the bbx corresponding to 10 is never taken into account as the list length is 4.

If I'm right and I'm not missing anything I would propose changing L189 to

for i in set(batch["batch_idx"].tolist()):

avoiding redundant iterations and making sure not to leave out anything.

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

No branches or pull requests

1 participant