Skip to content

Commit

Permalink
Fix scikit-image dependency specification (#675)
Browse files Browse the repository at this point in the history
* MAINT: Fix scikit-image >0.20 incompatibilities.

* Set minimum bound for scikit-image.

Necessary for new keyword argument support.
  • Loading branch information
rossbar authored Jul 14, 2023
1 parent af2b584 commit 35ee983
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions deepcell/image_generators/semantic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1040,14 +1040,14 @@ def _scale_im(input_im, scale, order):
rescaled = rescale(batch, scale,
order=order,
preserve_range=True,
multichannel=True)
channel_axis=-1)
rescaled = np.moveaxis(rescaled, -1, 0)

else:
rescaled = rescale(batch, scale,
order=order,
preserve_range=True,
multichannel=True)
channel_axis=-1)

batch_list.append(rescaled)
return np.stack(batch_list, axis=0).astype(dtype)
Expand Down
6 changes: 3 additions & 3 deletions deepcell/utils/transform_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def pixelwise_transform(mask, dilation_radius=None, data_format=None,
if dilation_radius:
dil_strel = ball(dilation_radius) if mask.ndim > 2 else disk(dilation_radius)
# Thicken cell edges to be more pronounced
edge = binary_dilation(edge, selem=dil_strel)
edge = binary_dilation(edge, footprint=dil_strel)

# Thin the augmented edges by subtracting the interior features.
edge = (edge - interior > 0).astype('int')
Expand Down Expand Up @@ -109,8 +109,8 @@ def pixelwise_transform(mask, dilation_radius=None, data_format=None,
if dilation_radius:
dil_strel = ball(dilation_radius) if mask.ndim > 2 else disk(dilation_radius)
# Thicken cell edges to be more pronounced
interior_edge = binary_dilation(interior_edge, selem=dil_strel)
background_edge = binary_dilation(background_edge, selem=dil_strel)
interior_edge = binary_dilation(interior_edge, footprint=dil_strel)
background_edge = binary_dilation(background_edge, footprint=dil_strel)

# Thin the augmented edges by subtracting the interior features.
interior_edge = (interior_edge - interior > 0).astype('int')
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
numpy>=1.16.6
scipy>=1.2.3,<2
scikit-image>=0.14.5,<0.20
scikit-image>=0.19.3
scikit-learn>=0.20.4
tensorflow~=2.8.0
tensorflow_addons~=0.16.1
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
'numpy>=1.16.6',
'pydot>=1.4.2,<2', # for keras.utils.plot_model
'scipy>=1.2.3,<2',
'scikit-image>=0.14.5,<0.20',
'scikit-image>=0.19.3',
'scikit-learn>=0.20.4',
'tensorflow~=2.8.0',
'tensorflow_addons~=0.16.1',
Expand Down

0 comments on commit 35ee983

Please sign in to comment.