[proto] Ported all transforms to the new API#6305
Merged
Conversation
* Added supported/unsupported data checks in the tests for cutmix/mixup * Added RandomRotation, RandomAffine transforms tests * Added tests for RandomZoomOut, Pad * Update test_prototype_transforms.py
* Added GaussianBlur transform and tests * Fixing code format * Copied correctness test
* Added random color transforms and tests * Disable smoke test for RandomSolarize, RandomAdjustSharpness
- replaced real image creation by mocks for other tests
* WIP [proto] Added functional elastic transform with tests * Added more functional tests * WIP on elastic op * Added elastic transform and tests * Added tests * Added tests for ElasticTransform
This was referenced Jul 25, 2022
* Added image_size computation for BoundingBox.rotate if expand * Added tests
a5a66d7 to
d226e16
Compare
datumbox
approved these changes
Jul 28, 2022
| def has_all(sample: Any, *types: Type) -> bool: | ||
| return not bool(set(types) - set(_extract_types(sample))) | ||
| flat_sample, _ = tree_flatten(sample) | ||
| return not bool(set(types) - set([type(obj) for obj in flat_sample])) |
Contributor
There was a problem hiding this comment.
This will fail if we subclass one of the types (say we subclass Feature.Image) but since that's not the intention now, we are OK to keep it as-is.
|
|
||
| # Process fill color for affine transforms | ||
| num_bands = len(img.getbands()) | ||
| num_bands = get_image_num_channels(img) |
Contributor
There was a problem hiding this comment.
Nit: Instead of num_bands use num_channels?
facebook-github-bot
pushed a commit
that referenced
this pull request
Aug 2, 2022
Summary: * [proto] Added few transforms tests, part 1 (#6262) * Added supported/unsupported data checks in the tests for cutmix/mixup * Added RandomRotation, RandomAffine transforms tests * Added tests for RandomZoomOut, Pad * Update test_prototype_transforms.py * Added RandomCrop transform and tests (#6271) * [proto] Added GaussianBlur transform and tests (#6273) * Added GaussianBlur transform and tests * Fixing code format * Copied correctness test * [proto] Added random color transforms and tests (#6275) * Added random color transforms and tests * Disable smoke test for RandomSolarize, RandomAdjustSharpness * Added RandomPerspective and tests (#6284) - replaced real image creation by mocks for other tests * Added more functional tests (#6285) * [proto] Added elastic transform and tests (#6295) * WIP [proto] Added functional elastic transform with tests * Added more functional tests * WIP on elastic op * Added elastic transform and tests * Added tests * Added tests for ElasticTransform * Try to format code as in #5106 * Fixed bug in affine get_params test * Implemented RandomErase on PIL input as fallback to tensors (#6309) Added tests * Added image_size computation for BoundingBox.rotate if expand (#6319) * Added image_size computation for BoundingBox.rotate if expand * Added tests * Added erase_image_pil and eager/jit erase_image_tensor test (#6320) * Updates according to the review Reviewed By: NicolasHug Differential Revision: D38351755 fbshipit-source-id: 4b52b530f93c3dfa92326e01803665cb44003a63 Co-authored-by: Vasilis Vryniotis <datumbox@users.noreply.github.com>
This was referenced Aug 19, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Please merge #6272 before this PRWhat remains
torchvision/prototype/transformsandtest/test_prototype_*. Mostly those to implement a missing functionality.Feature.opfor exampleBoundingBox.rotateas they change metadata likeimage_size.CI Failures to take into account: