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

add input image array shape check #54

Conversation

hankunxiao
Copy link
Collaborator

No description provided.

Copy link
Collaborator

@JennyonOort JennyonOort left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides indention, I don't see issue.

# Check input image array shape
if not (img_array.ndim == 2 or (img_array.ndim == 3 and img_array.shape[2] == 3)):
raise ValueError(
f"Invalid image shape: {img_array.shape}. "
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seems to be an indention issue?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are right. thanks for point it out. I have fixed it.

Copy link
Collaborator

@JennyonOort JennyonOort left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the interest of time, I am approving the PR. Please fix indention upon consolidation.

@hankunxiao hankunxiao merged commit 28f8420 into main Jan 16, 2025
2 of 4 checks passed
@hankunxiao hankunxiao deleted the 40-numpy-shape-must-be-3d-for-rgb-and-2d-for-grayscale-unexpected-or-redundant-channels-should-raise-error branch January 24, 2025 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Numpy shape: must be 3D for RGB and 2D for grayscale (unexpected or redundant channels should raise error)
2 participants