-
Notifications
You must be signed in to change notification settings - Fork 27.3k
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
Input data format #25464
Input data format #25464
Conversation
The documentation is not available anymore as the PR was closed or merged. |
c950341
to
8aef2a0
Compare
276cce5
to
e113320
Compare
e113320
to
3c5a39d
Compare
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 a lot for your work on this!
**kwargs, | ||
) -> np.ndarray: | ||
""" | ||
Resize the image to the given size. Size can be `min_size` (scalar) or `(height, width)` tuple. If size is an | ||
int, smaller edge of the image will be matched to this number. | ||
|
||
Args: |
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.
Nice to add this here!
Image to resize. | ||
size (`Dict[str, int]`): | ||
The size of the output image. | ||
size_divisor (`int`, *optional*, defaults to `0`): |
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.
Nit:
size_divisor (`int`, *optional*, defaults to `0`): | |
size_divisor (`int`, *optional*, defaults to 0): |
Image to resize. | ||
size (`Dict[str, int]`): | ||
The size of the output image. | ||
size_divisor (`int`, *optional*, defaults to `0`): |
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.
size_divisor (`int`, *optional*, defaults to `0`): | |
size_divisor (`int`, *optional*, defaults to 0): |
( may have missed some so worth doing a quick search!)
* Add copied from statements for image processors * Move out rescale and normalize to base image processor * Remove rescale and normalize from vit (post rebase) * Update docstrings and tidy up * PR comments * Add input_data_format as preprocess argument * Resolve tests and tidy up * Remove num_channels argument * Update doc strings -> default ints not in code formatting
What does this PR do?
Adds the
input_data_format
argument to all of the image processor methods.This allows for passing in of images with an unusual number of channels, or ones where it's difficult to infer because of ambiguity e.g size (3, 3, 3).
This is an alternative to #24577
Fixes issues like:
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.