Skip to content

Commit 4311367

Browse files
committed
"updating"
1 parent 0912bd3 commit 4311367

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

mean_iou.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,19 @@ def meanIoU(target, predicted):
110110

111111

112112
def mean_iou(y_pred, y_true):
113+
"""
114+
Calculates the mean Intersection over Union (IoU) between predicted labels and true labels.
115+
116+
The mean IoU is a common evaluation metric for semantic segmentation tasks.
117+
It measures the average overlap between the predicted and true labels.
118+
119+
Args:
120+
y_pred (array-like): Predicted labels.
121+
y_true (array-like): True labels or ground truth values.
122+
123+
Returns:
124+
float: Mean IoU value.
125+
"""
113126
y_pred = y_pred.flatten()
114127
y_true = y_true.flatten()
115128

0 commit comments

Comments
 (0)