@@ -15,13 +15,13 @@ def db_eval_iou(annotation, segmentation, void_pixels=None):
15
15
"""
16
16
assert annotation .shape == segmentation .shape , \
17
17
f'Annotation({ annotation .shape } ) and segmentation:{ segmentation .shape } dimensions do not match.'
18
- annotation = annotation .astype (np . bool )
19
- segmentation = segmentation .astype (np . bool )
18
+ annotation = annotation .astype (bool )
19
+ segmentation = segmentation .astype (bool )
20
20
21
21
if void_pixels is not None :
22
22
assert annotation .shape == void_pixels .shape , \
23
23
f'Annotation({ annotation .shape } ) and void pixels:{ void_pixels .shape } dimensions do not match.'
24
- void_pixels = void_pixels .astype (np . bool )
24
+ void_pixels = void_pixels .astype (bool )
25
25
else :
26
26
void_pixels = np .zeros_like (segmentation )
27
27
@@ -70,9 +70,9 @@ def f_measure(foreground_mask, gt_mask, void_pixels=None, bound_th=0.008):
70
70
"""
71
71
assert np .atleast_3d (foreground_mask ).shape [2 ] == 1
72
72
if void_pixels is not None :
73
- void_pixels = void_pixels .astype (np . bool )
73
+ void_pixels = void_pixels .astype (bool )
74
74
else :
75
- void_pixels = np .zeros_like (foreground_mask ).astype (np . bool )
75
+ void_pixels = np .zeros_like (foreground_mask ).astype (bool )
76
76
77
77
bound_pix = bound_th if bound_th >= 1 else \
78
78
np .ceil (bound_th * np .linalg .norm (foreground_mask .shape ))
@@ -134,7 +134,7 @@ def _seg2bmap(seg, width=None, height=None):
134
134
January 2003
135
135
"""
136
136
137
- seg = seg .astype (np . bool )
137
+ seg = seg .astype (bool )
138
138
seg [seg > 0 ] = 1
139
139
140
140
assert np .atleast_3d (seg ).shape [2 ] == 1
0 commit comments