Skip to content

Commit

Permalink
Update evaluators.py
Browse files Browse the repository at this point in the history
  • Loading branch information
matteo-stat committed Sep 10, 2023
1 parent 2d9ba98 commit 87c7736
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions ssdseglib/evaluators.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,7 @@ def jaccard_iou_semantic_segmentation(
masks_pred_batch: np.ndarray,
path_files_masks: List[str],
labels_codes: List[int],
label_code_background: int,
soft_jaccard_iou: bool = True
label_code_background: int
) -> Dict[str, float]:
"""
calculate the jaccard iou metric for each class for a semantic segmnetation problem\n
Expand All @@ -210,12 +209,7 @@ def jaccard_iou_semantic_segmentation(

# number of classes
num_classes = len(labels_codes)

# convert probabilities to classification if output metric it's hard jaccard iou
if not soft_jaccard_iou:
masks_pred_batch = np.argmax(masks_pred_batch, axis=-1)
masks_pred_batch = np.eye(num_classes, dtype=np.float32)[masks_pred_batch]


# read all ground truth masks
masks_true_batch = []
for path_file_mask in path_files_masks:
Expand Down

0 comments on commit 87c7736

Please sign in to comment.