Conversation
| h, w = image.spatial_size = (24, 32) | ||
|
|
||
| params = transform._get_params(image) | ||
| params = transform._get_params([image]) |
There was a problem hiding this comment.
All changes in this file stem from the fact that _get_params previously handled pytree objects, but now only handles flattened ones.
| [ | ||
| [transforms.Pad(2), transforms.RandomCrop(28)], | ||
| [lambda x: 2.0 * x, transforms.Pad(2), transforms.RandomCrop(28)], | ||
| [transforms.Pad(2), lambda x: 2.0 * x, transforms.RandomCrop(28)], |
There was a problem hiding this comment.
I've accidentally included this while playing with the container flattening. It is useful nevertheless to have the "foreign" transform also in the middle of the pipeline. Let me know if I should revert.
| prototype_transform = prototype_transforms.RandomApply( | ||
| [ | ||
| prototype_transforms.Resize(256), | ||
| legacy_transforms.CenterCrop(224), |
There was a problem hiding this comment.
This was just plain wrong. It never triggered because the input is a single image. Found this while playing with the container flattening.
| return key, dct[key] | ||
|
|
||
| def _extract_image_or_video( | ||
| def _flatten_and_extract_image_or_video( |
There was a problem hiding this comment.
I've opted to group the flattening and extraction as well as the unflattening and insertion since that yielded the cleanest results.
Reviewed By: NicolasHug Differential Revision: D40427480 fbshipit-source-id: 0552b32b56e5292a64060fcddde46feca4137b6a
Closes #6760 minus the container handling as stated in #6760 (comment).