Skip to content

Commit

Permalink
Fix new skimage channel_axis (#1421)
Browse files Browse the repository at this point in the history
Co-authored-by: Mikhail Druzhinin <dipet@gmail.com>
  • Loading branch information
Dipet and Mikhail Druzhinin committed Mar 8, 2023
1 parent cb37273 commit 227bd74
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions albumentations/augmentations/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -1272,9 +1272,9 @@ def superpixels(
resize_fn = _maybe_process_in_chunks(cv2.resize, dsize=(new_width, new_height), interpolation=interpolation)
image = resize_fn(image)

from skimage.segmentation import slic

segments = skimage.segmentation.slic(image, n_segments=n_segments, compactness=10)
segments = skimage.segmentation.slic(
image, n_segments=n_segments, compactness=10, channel_axis=-1 if image.ndim > 2 else None
)

min_value = 0
max_value = MAX_VALUES_BY_DTYPE[image.dtype]
Expand Down

0 comments on commit 227bd74

Please sign in to comment.