|
7 | 7 |
|
8 | 8 |
|
9 | 9 | def f_score(precision, recall, beta=1): |
10 | | - """calcuate the f-score value. |
| 10 | + """calculate the f-score value. |
11 | 11 |
|
12 | 12 | Args: |
13 | 13 | precision (float | torch.Tensor): The precision value. |
@@ -40,7 +40,7 @@ def intersect_and_union(pred_label, |
40 | 40 | ignore_index (int): Index that will be ignored in evaluation. |
41 | 41 | label_map (dict): Mapping old labels to new labels. The parameter will |
42 | 42 | work only when label is str. Default: dict(). |
43 | | - reduce_zero_label (bool): Wether ignore zero label. The parameter will |
| 43 | + reduce_zero_label (bool): Whether ignore zero label. The parameter will |
44 | 44 | work only when label is str. Default: False. |
45 | 45 |
|
46 | 46 | Returns: |
@@ -102,7 +102,7 @@ def total_intersect_and_union(results, |
102 | 102 | num_classes (int): Number of categories. |
103 | 103 | ignore_index (int): Index that will be ignored in evaluation. |
104 | 104 | label_map (dict): Mapping old labels to new labels. Default: dict(). |
105 | | - reduce_zero_label (bool): Wether ignore zero label. Default: False. |
| 105 | + reduce_zero_label (bool): Whether ignore zero label. Default: False. |
106 | 106 |
|
107 | 107 | Returns: |
108 | 108 | ndarray: The intersection of prediction and ground truth histogram |
@@ -148,7 +148,7 @@ def mean_iou(results, |
148 | 148 | nan_to_num (int, optional): If specified, NaN values will be replaced |
149 | 149 | by the numbers defined by the user. Default: None. |
150 | 150 | label_map (dict): Mapping old labels to new labels. Default: dict(). |
151 | | - reduce_zero_label (bool): Wether ignore zero label. Default: False. |
| 151 | + reduce_zero_label (bool): Whether ignore zero label. Default: False. |
152 | 152 |
|
153 | 153 | Returns: |
154 | 154 | dict[str, float | ndarray]: |
@@ -187,7 +187,7 @@ def mean_dice(results, |
187 | 187 | nan_to_num (int, optional): If specified, NaN values will be replaced |
188 | 188 | by the numbers defined by the user. Default: None. |
189 | 189 | label_map (dict): Mapping old labels to new labels. Default: dict(). |
190 | | - reduce_zero_label (bool): Wether ignore zero label. Default: False. |
| 190 | + reduce_zero_label (bool): Whether ignore zero label. Default: False. |
191 | 191 |
|
192 | 192 | Returns: |
193 | 193 | dict[str, float | ndarray]: Default metrics. |
@@ -228,7 +228,7 @@ def mean_fscore(results, |
228 | 228 | nan_to_num (int, optional): If specified, NaN values will be replaced |
229 | 229 | by the numbers defined by the user. Default: None. |
230 | 230 | label_map (dict): Mapping old labels to new labels. Default: dict(). |
231 | | - reduce_zero_label (bool): Wether ignore zero label. Default: False. |
| 231 | + reduce_zero_label (bool): Whether ignore zero label. Default: False. |
232 | 232 | beta (int): Determines the weight of recall in the combined score. |
233 | 233 | Default: False. |
234 | 234 |
|
@@ -274,7 +274,7 @@ def eval_metrics(results, |
274 | 274 | nan_to_num (int, optional): If specified, NaN values will be replaced |
275 | 275 | by the numbers defined by the user. Default: None. |
276 | 276 | label_map (dict): Mapping old labels to new labels. Default: dict(). |
277 | | - reduce_zero_label (bool): Wether ignore zero label. Default: False. |
| 277 | + reduce_zero_label (bool): Whether ignore zero label. Default: False. |
278 | 278 | Returns: |
279 | 279 | float: Overall accuracy on all images. |
280 | 280 | ndarray: Per category accuracy, shape (num_classes, ). |
|
0 commit comments