Skip to content

Instance Segmentation Confusion Matrix#240

Open
mayankagarwals wants to merge 22 commits intoroboflow:developfrom
mayankagarwals:segmentationConfusionMat
Open

Instance Segmentation Confusion Matrix#240
mayankagarwals wants to merge 22 commits intoroboflow:developfrom
mayankagarwals:segmentationConfusionMat

Conversation

@mayankagarwals
Copy link
Copy Markdown
Contributor

@mayankagarwals mayankagarwals commented Jul 25, 2023

Description

Solves for #238

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How has this change been tested, please provide a testcase or example of how you tested the change?

Please use this colab for testing: https://colab.research.google.com/drive/1OKjyH8JmFMROJ97447DUn13p-GDP6dXl
Test cases have been added

return area_inter / (area_true[:, None] + area_detection - area_inter)


def mask_iou_batch(masks_true: np.ndarray, masks_detection: np.ndarray) -> np.ndarray:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mayankagarwals let's add unit tests

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey! Yep, waiting for some discussion to happen with respect to API here #238 before completing the feature

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added!

@SkalskiP
Copy link
Copy Markdown
Collaborator

SkalskiP commented Aug 1, 2023

Hi @mayankagarwals 👋🏻! Is that code ready for review? It is still marked as draft.

@SkalskiP SkalskiP added the enhancement New feature or request label Aug 1, 2023
@SkalskiP SkalskiP added this to the version: 0.13.0 milestone Aug 1, 2023
@SkalskiP SkalskiP added the version: 0.13.0 Feature to be added in `0.13.0` release label Aug 1, 2023
@mayankagarwals
Copy link
Copy Markdown
Contributor Author

Hey @SkalskiP. No, the code is still not complete as I'm waiting for your input on #238. There are two different ways we can design the API.

@SkalskiP SkalskiP added the version 0.14.0 Feature to be added in `0.14.0` release label Aug 7, 2023
@SkalskiP
Copy link
Copy Markdown
Collaborator

SkalskiP commented Aug 7, 2023

@mayankagarwals okey I'm rolling that PR over to supervision-0.14.0

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Aug 11, 2023

CLA assistant check
All committers have signed the CLA.

@mayankagarwals
Copy link
Copy Markdown
Contributor Author

mayankagarwals commented Aug 15, 2023

Hi @kirilllzaitsev @hardikdava @SkalskiP

While the code here is functional, I wanted to ask your opinion on force_masks

Right now I'm assuming if force_masks is passed we will enforce that every detection in the from_detections is accompanied by a mask.
The segmentation confusion matrix is computed only when force_masks is passed

@kirilllzaitsev
Copy link
Copy Markdown
Contributor

@mayankagarwals hey, this PR should be relevant. force_masks=True refers to the case when the masks are enforced, while if force_masks=False, but the masks are present in annotations ('segmentation' field), they will be parsed since now

@mayankagarwals
Copy link
Copy Markdown
Contributor Author

mayankagarwals commented Aug 16, 2023

hi @kirilllzaitsev!

Cool! I guess then it makes sense to provide a segmentation matrix only if force_masks = true.

@kirilllzaitsev @hardikdava
Before I wrap up the documentation and tests, can you please go through the PR and let me know if you have any queries or concerns?

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

Labels

enhancement New feature or request has conflicts version: 0.13.0 Feature to be added in `0.13.0` release version 0.14.0 Feature to be added in `0.14.0` release

Projects

Status: Next Release

Development

Successfully merging this pull request may close these issues.

4 participants