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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slice() function question #1

Open
yrsunn opened this issue Feb 11, 2023 · 2 comments
Open

Slice() function question #1

yrsunn opened this issue Feb 11, 2023 · 2 comments

Comments

@yrsunn
Copy link

yrsunn commented Feb 11, 2023

Hi,

when I run the resize or crop function in your code, I got the error here:

IndexError: only integers, slices (:), ellipsis (...), numpy.newaxis (None) and integer or boolean arrays are valid indices

It happens at the slicer object.

Do you know why this happened? Thank you so much!

@MiriamBalzer
Copy link

MiriamBalzer commented Mar 30, 2023

I have the same issue. Did you find a solution for yourself?

@MiriamBalzer
Copy link

In case somebody else is having this issue: the solution should be to change the return line of this function to
return np.pad(image[tuple(slicer)], to_padding, **kwargs)

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

2 participants