Add tests and proper support for videos in ConvertImageDtype#6783
Add tests and proper support for videos in ConvertImageDtype#6783pmeier merged 10 commits intopytorch:mainfrom
ConvertImageDtype#6783Conversation
| # 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.
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.
@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
…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