Skip to content

Commit ac7c43f

Browse files
authored
Merge pull request davisvideochallenge#12 from fiskrt/master
Removed depricated np.bool and fixed davisvideochallenge#11
2 parents d34fdef + 4053b46 commit ac7c43f

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

davis2017/metrics.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ def db_eval_iou(annotation, segmentation, void_pixels=None):
1515
"""
1616
assert annotation.shape == segmentation.shape, \
1717
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)
2020

2121
if void_pixels is not None:
2222
assert annotation.shape == void_pixels.shape, \
2323
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)
2525
else:
2626
void_pixels = np.zeros_like(segmentation)
2727

@@ -70,9 +70,9 @@ def f_measure(foreground_mask, gt_mask, void_pixels=None, bound_th=0.008):
7070
"""
7171
assert np.atleast_3d(foreground_mask).shape[2] == 1
7272
if void_pixels is not None:
73-
void_pixels = void_pixels.astype(np.bool)
73+
void_pixels = void_pixels.astype(bool)
7474
else:
75-
void_pixels = np.zeros_like(foreground_mask).astype(np.bool)
75+
void_pixels = np.zeros_like(foreground_mask).astype(bool)
7676

7777
bound_pix = bound_th if bound_th >= 1 else \
7878
np.ceil(bound_th * np.linalg.norm(foreground_mask.shape))
@@ -134,7 +134,7 @@ def _seg2bmap(seg, width=None, height=None):
134134
January 2003
135135
"""
136136

137-
seg = seg.astype(np.bool)
137+
seg = seg.astype(bool)
138138
seg[seg > 0] = 1
139139

140140
assert np.atleast_3d(seg).shape[2] == 1

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
'scikit-learn>=0.18',
1818
'scipy>=1.0.0',
1919
'tqdm>=4.28.1'
20-
])
20+
],packages=['davis2017'])

0 commit comments

Comments
 (0)