-
Notifications
You must be signed in to change notification settings - Fork 29.2k
docs: Details for ambigious channel dimension assignment #37600
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
Conversation
Hi 👋, thank you for opening this pull request! The pull request is converted to draft by default. The CI will be paused while the PR is in draft mode. When it is ready for review, please click the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I think this should be ok! We can merge once our vision expert approves as well 😄
src/transformers/image_utils.py
Outdated
@@ -368,7 +368,7 @@ def infer_channel_dimension_format( | |||
|
|||
if image.shape[first_dim] in num_channels and image.shape[last_dim] in num_channels: | |||
logger.warning( | |||
f"The channel dimension is ambiguous. Got image shape {image.shape}. Assuming channels are the first dimension." | |||
f"The channel dimension is ambiguous. Got image shape {image.shape}. Assuming channels are the first dimension. Use the `input_data_format` parameter to assign the channel dimension, more details in `https://huggingface.co/docs/transformers/main/internal/image_processing_utils#transformers.image_transforms.rescale.input_data_format`." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @qubvel, would you mind taking a quick look and verifying this please? 🤗
f"The channel dimension is ambiguous. Got image shape {image.shape}. Assuming channels are the first dimension. Use the `input_data_format` parameter to assign the channel dimension, more details in `https://huggingface.co/docs/transformers/main/internal/image_processing_utils#transformers.image_transforms.rescale.input_data_format`." | |
f"The channel dimension is ambiguous. Got image shape {image.shape}. Assuming channels are the first dimension. Use the [input_data_format](https://huggingface.co/docs/transformers/main/internal/image_processing_utils#transformers.image_transforms.rescale.input_data_format) parameter to assign the channel dimension." |
Co-authored-by: Steven Liu <[email protected]>
Hi, any progress? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for update, looks good to me 👍
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
…#37600) * docs: Details for ambigious channel dimension inference * Update src/transformers/image_utils.py Co-authored-by: Steven Liu <[email protected]> --------- Co-authored-by: Steven Liu <[email protected]>
What does this PR do?
Refined docs on how to assign channel dimension of inputs.
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
@stevhliu