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

Bug found in ConfusionMatrix.from_detections #1619

Open
1 task done
chiggins2024 opened this issue Oct 24, 2024 · 2 comments
Open
1 task done

Bug found in ConfusionMatrix.from_detections #1619

chiggins2024 opened this issue Oct 24, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@chiggins2024
Copy link

Search before asking

  • I have searched the Supervision issues and found no similar bug report.

Bug

Issue found in code when producing a confusion matrix for object detection. It seems like the FN was being added incorrectly to the matrix. Here is the code that was problematic for me. When removing the else condition, I was getting the correct TP value. It seems that num_classes, ends up being at the same position detection_classes[matched_detection_idx[j]]

        ```
for i, true_class_value in enumerate(true_classes):
            j = matched_true_idx == i
            print('sum(j)', sum(j))
            if matches.shape[0] > 0 and sum(j) == 1:
                result_matrix[
                    true_class_value, detection_classes[matched_detection_idx[j]]
                ] += 1  # TP
            else:
                result_matrix[true_class_value, num_classes] += 1  # FN

### Environment

_No response_

### Minimal Reproducible Example

_No response_

### Additional

_No response_

### Are you willing to submit a PR?

- [ ] Yes I'd like to help by submitting a PR!
@chiggins2024 chiggins2024 added the bug Something isn't working label Oct 24, 2024
@LinasKo
Copy link
Collaborator

LinasKo commented Nov 1, 2024

Hi @chiggins2024 👋

Thank you for the report. We'll check it as soon as we can!
As we're transitioning away from the legacy MeanAveragePrecision and ConfusionMatrix, most likely the fix will come as a new ConfusionMatrix version.

@chiggins2024
Copy link
Author

chiggins2024 commented Nov 4, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants