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

Feature/semseg misclassification #628

Merged
merged 22 commits into from
May 24, 2023
Merged

Conversation

dcaustin33
Copy link
Contributor

Adds misclassification to semseg polygons

@dcaustin33 dcaustin33 requested a review from a team as a code owner May 22, 2023 23:10
@codecov-commenter
Copy link

codecov-commenter commented May 22, 2023

Codecov Report

Merging #628 (0c1738d) into main (483acdb) will decrease coverage by 0.64%.
The diff coverage is 18.03%.

@@            Coverage Diff             @@
##             main     #628      +/-   ##
==========================================
- Coverage   84.39%   83.76%   -0.64%     
==========================================
  Files         164      165       +1     
  Lines       12964    12959       -5     
==========================================
- Hits        10941    10855      -86     
- Misses       2023     2104      +81     
Impacted Files Coverage Δ
...ity/integrations/cv/torch/semantic_segmentation.py 0.00% <0.00%> (ø)
...lity/loggers/model_logger/semantic_segmentation.py 0.00% <0.00%> (ø)
dataquality/utils/semantic_segmentation/errors.py 0.00% <0.00%> (ø)
...ataquality/utils/semantic_segmentation/polygons.py 0.00% <0.00%> (ø)
dataquality/schemas/ml.py 100.00% <100.00%> (ø)
dataquality/schemas/semantic_segmentation.py 81.81% <100.00%> (+1.81%) ⬆️

... and 11 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Comment on lines 27 to 29
accuracy: Optional[float] = None
dominant_mislabel_class: Optional[int] = None
dominant_mislabel_class_percent: Optional[float] = None
Copy link
Contributor

Choose a reason for hiding this comment

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

if these are all present when we instantiate the object, we don't need them to be optional

@@ -15,6 +15,20 @@ class SemSegCols(str, Enum):
meta = "meta"


class ClassificationData(BaseModel):
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe ClassificationErrorData

@@ -15,6 +15,20 @@ class SemSegCols(str, Enum):
meta = "meta"


class ClassificationData(BaseModel):
"""
accuracy: float the mean accuracy per pixel
Copy link
Contributor

Choose a reason for hiding this comment

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

what does "mean accuracy per pixel" mean? specifically the word "mean" in this context

@@ -30,7 +44,7 @@ class IoUType(str, Enum):
class IouData(BaseModel):
iou: float
iou_per_class: List[float]
area_per_class: List[int]
area_per_class: List[float]
Copy link
Contributor

Choose a reason for hiding this comment

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

if this is a float are the other area values a float? if so we should update the fn typing to return float not int

@@ -62,7 +76,7 @@ class Contour(BaseModel):
class Polygon(BaseModel):
uuid: str # UUID4
label_idx: int
misclassified_class_label: Optional[int] = None
classification_data: ClassificationData = ClassificationData()
Copy link
Contributor

Choose a reason for hiding this comment

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

just have this be optional and default to None

Comment on lines +231 to +236
add_classification_error_to_polygons_batch(
self.pred_masks, gold_polygons_batch, n_classes
)
add_classification_error_to_polygons_batch(
self.gold_masks, pred_polygons_batch, n_classes
)
Copy link
Contributor

Choose a reason for hiding this comment

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

why are we doing it for both now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We want both to have classification accuracy and errors

Copy link
Contributor

@elboy3 elboy3 left a comment

Choose a reason for hiding this comment

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

lgtm

@elboy3
Copy link
Contributor

elboy3 commented May 24, 2023

@dcaustin33 dcaustin33 merged commit 20df3a8 into main May 24, 2023
@dcaustin33 dcaustin33 deleted the feature/semseg_misclassification branch May 24, 2023 19:51
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.

3 participants