Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

RandomGridShuffle error #1375

Closed
bekhzod-olimov opened this issue Jan 4, 2023 · 2 comments
Closed

RandomGridShuffle error #1375

bekhzod-olimov opened this issue Jan 4, 2023 · 2 comments

Comments

@bekhzod-olimov
Copy link

馃悰 Bug

RandomGridShuffle does not function properly.

To Reproduce

plt.figure(figsize=(15,10))
display_ims = 20
grid = (3, 3)
p = 0.5

for i in range(display_ims):   
    tfs = A.Compose([A.RandomGridShuffle()])
    tfs_im = tfs(image=im)
    plt.subplot(4, display_ims // 4, i+1)
    plt.imshow(tfs_im["image"])
    plt.axis("off")

Environment

  • Albumentations version (1.3.0):
  • Python version (3.9):
  • OS (Linux):
  • How you installed albumentations (pip):

Additional context

height_split = np.linspace(0, height, n + 1, dtype=np.int)
width_split = np.linspace(0, width, m + 1, dtype=np.int)

AttributeError: module 'numpy' has no attribute 'int'

@adrigrillo
Copy link

This should be fixed now with the change from np.int to np.int32 here:

height_split = np.linspace(0, height, n + 1, dtype=np.int32)
width_split = np.linspace(0, width, m + 1, dtype=np.int32)

in https://github.com/albumentations-team/albumentations/blob/e3b47b3a127f92541cfeb16abbb44a6f8bf79cc8/albumentations/augmentations/transforms.py#LL138C1-L139C67 so this can be closed.

@ternaus
Copy link
Collaborator

ternaus commented Mar 14, 2024

Thanks @adrigrillo

@ternaus ternaus closed this as completed Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants