-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Add tests and proper support for videos in ConvertImageDtype
#6783
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
| # prevalent and well understood. Thus, we just alias it without deprecating the old name. | ||
| to_pil_image = to_image_pil | ||
|
|
||
| convert_image_dtype = _F.convert_image_dtype |
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.
This was in here by mistake I think. The old transform ConvertImageDtype as well as the other conversion transform functionals were already under the _meta namespace. Thus, I moved this there.
|
I think |
|
I agree, naming is most pressing thing here. But then |
|
Maybe, emphasize somehow that we change dtype for sample (not targets) ? |
datumbox
left a comment
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.
@pmeier Thanks for the work.
I agree with the direction of the PR. I have 2 concerns over the use of copy and the introduction of more methods in some of the _Feature subclasses.
Concerning the conflicts with other PRs, this PR looks like it adds more tests and aligns the API which is less dangerous than rewriting the convert_dtype_image_tensor method. How confident are you about the changes on the other PR? Do you think we can benefit by these extra tests and thus prioritise merging this PR first?
Conflicts: test/prototype_transforms_kernel_infos.py torchvision/prototype/transforms/functional/_type_conversion.py
datumbox
left a comment
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.
LGTM, thanks!
…e` (#6783) Summary: * add KernelInfo * split dtype and device consistency tests * add proper support for video * fix tests and add DispatcherInfo * add aliases * cleanup * fix typo Reviewed By: YosuaMichael Differential Revision: D40722908 fbshipit-source-id: 36adda72819a12167ed12d27f6715a46c8ee9b56
#6724 shoehorned support for
features.VideointoConvertImageDtype. The implementation is correct, but the naming is confusing since it explicitly mentions images, but now also supports videos.Furthermore, we don't have a canonical dispatcher as we do for all other kernels that support for two or more types. Again, this works since videos can be treated as images here but makes the naming confusing, e.g.
F.convert_image_dtype(video).This PR does a few things:
ConvertImageDtypeandconvert_image_dtypetoConvertDtypeandconvert_dtypewhile keeping aliases for the former namesconvert_dtype_image_tensorandconvert_dtype_videokernels and makeconvert_dtypea proper dispatcher of the former