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

Tiny change to make misclassified compute correctly #614

Merged
merged 3 commits into from
May 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ coco_dataset/
coco.ipynb

# SemSeg
coco_deeplab_hooks.ipynb
setu4993 marked this conversation as resolved.
Show resolved Hide resolved
CV_datasets/
coco_hf_dataset.py
coco_deeplab_hooks.ipynb
large_run.ipynb
7 changes: 6 additions & 1 deletion dataquality/utils/semantic_segmentation/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ def polygon_accuracy(
returns: pixel accuracy of the predictions
"""
relevant_region = gold_mask != 0
pointwise_accuracy = (preds == gold_mask)[relevant_region]
relevant_pred_region = preds != 0
# use the relevant region to only select the pixels in the polygon
# use the relevant_pred_region to only select the pixels in the pred polygon
# that are not background pixels as classification errors are only
# counted for non-background pixels
pointwise_accuracy = (preds == gold_mask)[relevant_region & relevant_pred_region]

misclassified_class = calculate_misclassified_class(
preds, gold_mask, correct_class, relevant_region
Expand Down