- 18 Sep, 2020 1 commit
-
-
dddzg authored
Co-authored-by:vfdev <vfdev.5@gmail.com>
-
- 03 Sep, 2020 1 commit
-
-
Dragos Cristian authored
* adjust_hue now supports inputs of type Tensor * Added comparison between original adjust_hue and its Tensor and torch.jit.script versions. * Added a few type checkings related to adjust_hue in functional_tensor.py in hopes to make F_t.adjust_hue scriptable...but to no avail. * Changed implementation of _rgb2hsv and removed useless type declaration according to PR's review. * Handled the range of hue_factor in the assertions and temporarily increased the assertLess bound to make sure that no other test fails. * Fixed some lint issues with CircleCI and added type hints in functional_pil.py as well. * Corrected type hint mistakes. * Followed PR review recommendations and added test for class interface with hue. * Refactored test_functional_tensor.py to match vfdev-5's d016cab branch by simple copy/paste and added the test_adjust_hue and ColorJitter class interface test in the same style (class interface test was removed in vfdev-5's branch for some reason). * Removed test_adjustments from test_transforms_tensor.py and moved the ColorJitter class interface test in test_transforms_tensor.py. * Added cuda test cases for test_adjustments and tried to fix conflict. * Updated tests - adjust hue - color jitter * Fixes incompatible devices * Increased tol for cuda tests * Fixes potential issue with inplace op - fixes irreproducible failing test on Travis CI * Reverted fmod -> % Co-authored-by:vfdev-5 <vfdev.5@gmail.com>
-
- 28 Aug, 2020 1 commit
-
-
vfdev authored
* [WIP] Unify ops Grayscale and RandomGrayscale * Unified inputs for grayscale op and transforms - deprecated F.to_grayscale in favor of F.rgb_to_grayscale * Fixes bug with fp input * [WIP] Updated code according to review * Removed unused import
-
- 20 Aug, 2020 1 commit
-
-
vfdev authored
* Adapted almost all functional tensor tests on CPU/CUDA - fixed bug with transforms using generated grid - remains *_crop, blocked by #2568 - TODO: test_adjustments * Apply suggestions from code review Co-authored-by:
Francisco Massa <fvsmassa@gmail.com> * Fixed issues according to review * Split tests into two: cpu and cuda * Updated test_adjustments to run on CPU and CUDA Co-authored-by:
Francisco Massa <fvsmassa@gmail.com>
-
- 07 Aug, 2020 2 commits
-
-
vfdev authored
* [WIP] Added unified input perspective transformation code * Unified input for F.perspective - added tests - updated docs * Added more random test configs * Fixed the code according to PR's review
-
vfdev authored
* Added code for F_t.rotate with test - updated F.affine tests * Rotate test tolerance to 2% * Fixes failing test * [WIP] RandomRotation * Unified RandomRotation with tests
-
- 06 Aug, 2020 1 commit
-
-
vfdev authored
* Added code for F_t.rotate with test - updated F.affine tests * Rotate test tolerance to 2% * Fixes failing test * Optimized _expanded_affine_grid with a single matmul op * Recoded _compute_output_size * [WIP] recoded F_t.rotate internal methods * [WIP] Fixed F.affine to support rectangular images * Recoded _gen_affine_grid to optimized version ~ affine_grid - Fixes flake8 * [WIP] Use _gen_affine_grid for affine and rotate * Fixed tests on square / rectangular images for affine and rotate ops * Removed redefinition of F.rotate - due to bad merge
-
- 05 Aug, 2020 1 commit
-
-
vfdev authored
* Added code for F_t.rotate with test - updated F.affine tests * Rotate test tolerance to 2% * Fixes failing test * Optimized _expanded_affine_grid with a single matmul op * Recoded _compute_output_size
-
- 29 Jul, 2020 1 commit
-
-
vfdev authored
* [WIP] Unified input for T.RandomAffine * Unified inputs for T.RandomAffine transformation * Update transforms.py * Updated docs of F.affine fillcolor * Update transforms.py
-
- 17 Jul, 2020 1 commit
-
-
Brian Vaughan authored
* add torchscriptable adjust_gamma transform https://github.com/pytorch/vision/issues/1375 * changes based on code-review * Apply suggested change to add type hint Required by mypy, even thought technically incorrect due to possible Image parameter. torchscript doesn't support a union based type hint. Co-authored-by:
vfdev <vfdev.5@gmail.com> Co-authored-by:
vfdev <vfdev.5@gmail.com>
-
- 16 Jul, 2020 1 commit
-
-
vfdev authored
* [WIP] F.affine * [WIP] F.affine + tests * Unified input for F.affine * Removed commented code * Removed unused imports
-
- 15 Jul, 2020 1 commit
-
-
vfdev authored
Incoherence is when affine transformation is 90 degrees rotation and output contains a zero line
-
- 08 Jul, 2020 1 commit
-
-
vfdev authored
* Minor docs improvement * Replaced link by already defined `filters`_
-
- 07 Jul, 2020 1 commit
-
-
vfdev authored
* [WIP] Unify random resized crop * Unify input for RandomResizedCrop * Fixed bugs and updated test * Added resized crop functional test - fixed bug with size convention * Fixed incoherent sampling * Fixed torch randint review remark
-
- 06 Jul, 2020 1 commit
-
-
vfdev authored
* [WIP] F.resize with tensor * Adapted T.Resize and F.resize with a test * According to the review, fixed copy-pasted messages and unused imports
-
- 03 Jul, 2020 1 commit
-
-
vfdev authored
* Related to #2292 - RandomErasing is not scriptable * Fixed code according to review comments - added additional checking of value vs img num_channels
-
- 30 Jun, 2020 2 commits
-
-
vfdev authored
- RandomCrop: crop with padding using all commonly supported modes
-
vfdev authored
* [WIP] Unified Tensor/PIL crop * Fixed misplaced type annotation * Fixed tests - crop with padding - other tests using mising private functions: _is_pil_image, _get_image_size * Unified CenterCrop and F.center_crop - sorted includes in transforms.py - used py3 annotations * Unified FiveCrop and F.five_crop * Improved tests and docs * Unified TenCrop and F.ten_crop * Removed useless typing in functional_pil * Updated code according to the review - removed useless torch.jit.export - added missing typing return type - fixed F.F_pil._is_pil_image -> F._is_pil_image * Removed useless torch.jit.export * Improved code according to the review
-
- 26 Jun, 2020 1 commit
-
-
vfdev authored
* [WIP] Add Tensor implementation for pad * Unified Pad and F.pad opertion for PIL and Tensor inputs * Added another test and improved docstring * Updates according to the review * Cosmetics and replaced f-string by "".format * Updated docstring - added compatibility support for padding as [value, ] for functional_pil.pad Co-authored-by:Francisco Massa <fvsmassa@gmail.com>
-
- 19 Jun, 2020 1 commit
-
-
Vitaliy Chiley authored
I was reading through the code and noticed a few spelling errors orignal -> original maintaing -> maintaining
-
- 11 Jun, 2020 1 commit
-
-
Philip Meier authored
* add convert_image_dtype to functionals * add ConvertImageDtype transform * add test * remove underscores from numbers since they are not compatible with python<3.6 * address review comments 1/3 * fix torch.bool * use torch.iinfo in test * fix flake8 * remove double conversion * fix flake9 * bug fix * add error messages to test * disable torch.float16 and torch.half for now * add docstring * add test for consistency * move nested function to top * test in CI * dirty progress * add int to int and cleanup * lint Co-authored-by:Philip Meier <meier.philip@posteo.de>
-
- 10 Jun, 2020 1 commit
-
-
Clement Joudet authored
* feat: torchscriptable adjusments * fix: tensor output type * feat: ColorJitter torchscriptable * fix: too many blank lines * fix: documentation spacing and torchscript annotation * refactor: list type for _check_input * refactor: reverting to original syntax Co-authored-by:clement.joudet <clement.joudet@inventia.life>
-
- 04 Jun, 2020 2 commits
-
-
Francisco Massa authored
* Make RandomHorizontalFlip torchscriptable * Make _is_tensor_a_torch_image more generic * Make RandomVerticalFlip torchscriptable (#2283) * Make RandomVerticalFlip torchscriptable * Fix lint
-
Francisco Massa authored
* Bugfix in pad * Address review comments * Fix lint
-
- 18 May, 2020 2 commits
-
-
Steven Basart authored
* Adds as_tensor to functional.py Similar functionality to to_tensor without the default conversion to float and division by 255. Also adds support for Image mode 'L'. * Adds tests to AsTensor() Adds tests to AsTensor and removes the conversion to float and division by 255. * Adds AsTensor to transforms.py Calls the as_tensor function in functionals and adds the function AsTensor as callable from transforms. * Removes the pic.mode == 'L' This was handled by the else condition previously so I'll remove it. * Fix Lint issue Adds two line breaks between functions to fix lint issue * Replace from_numpy with as_tensor Removes the extra if conditionals and replaces from_numpy with as_tensor. * Renames as_tensor to pil_to_tensor Renames the function as_tensor to pil_to_tensor and narrows the scope of the function. At the same time also creates a flag that defaults to True for swapping to the channels first format. * Renames AsTensor to PILToImage Renames the function AsTensor to PILToImage and modifies the description. Adds the swap_to_channelsfirst boolean variable to indicate if the user wishes to change the shape of the input. * Add the __init__ function to PILToTensor Add the __init__ function to PILToTensor since it contains the swap_to_channelsfirst parameter now. * fix lint issue remove trailing white space * Fix the tests Reflects the name change to PILToTensor and the parameter to the function as well as the new narrowed scope that the function only accepts PIL images. * fix tests Instead of undoing the transpose just create a new tensor and test that one. * Add the view back Add img.view(pic.size[1], pic.size[0], len(pic.getbands())) back to outside the if condition. * fix test fix conversion from torch tensor to PIL back to torch tensor. * fix lint issues * fix lint remove trailing white space * Fixed the channel swapping tensor test Torch tranpose operates differently than numpy transpose. Changed operation to permute. * Add mode='F' Add mode information when converting to PIL Image from Float Tensor. * Added inline comments to follow shape changes * ToPILImage converts FloatTensors to uint8 * Remove testing not swapping * Removes the swap_channelsfirst parameter Makes the channel swapping the default behavior. * Remove the swap_channelsfirst argument Remove the swap_channelsfirst argument and makes the swapping the default functionality.
-
Francisco Massa authored
-
- 04 May, 2020 1 commit
-
-
Oscar Mañas authored
-
- 03 Apr, 2020 1 commit
-
-
Francisco Massa authored
* Add CircleCI job for python lint * Break lint * Fix * Fix lint * Re-enable all tests and remove travis python lint
-
- 02 Apr, 2020 1 commit
-
-
Francisco Massa authored
Summary: Fix docstring formatting issues Reviewed By: fmassa Differential Revision: D20736644 fbshipit-source-id: 78f66045cfd4c84cb35ca84a1e1fa6aadcd50642 Co-authored-by:Patrick Labatut <plabatut@fb.com>
-
- 01 Apr, 2020 2 commits
-
-
Philip Meier authored
-
Andrew Murray authored
Co-authored-by:Andrew Murray <radarhere@users.noreply.github.com>
-
- 31 Mar, 2020 1 commit
-
-
Philip Meier authored
* remove sys.version_info == 2 * remove sys.version_info < 3 * remove from __future__ imports
-
- 30 Mar, 2020 1 commit
-
-
theonekeyg authored
-
- 23 Mar, 2020 2 commits
-
-
Willie Maddox authored
* Add fill option to RandomPerspective #1972 * Minor fix to docstring syntax * Add _parse_fill() to get fillcolor (#1972) * Minor refactoring as per comments. * Added test for RandomPerspective with fillcolor. * Force perspective transform in test.
-
Danylo Ulianych authored
* F.normalize unsqueeze mean & std if necessary * added tests to F.normalize for 3d mean & std tensors
-
- 27 Feb, 2020 1 commit
-
-
Eldar Kurtic authored
-
- 25 Feb, 2020 1 commit
-
-
Phoenix Meadowlark authored
* Improved error messages for transforms.functional.normalize(). Split the original TypeError into 1. a TypeError if `tensor` is not a torch.Tensor and 2. a ValueError if `tensor` does not have the correct dimensionality. Added more detail to the error for when `tensor` has the wrong dimension to make it easier to diagnose. This is useful when this function isn't called directly by the user (e.g. when the user uses transforms.Normalize and can't directly see this functions doc string). Deleted hanging function `_is_tensor_image()`. It isn't used in this file and isn't used internally anywhere else in torchvision that I can see. (Some users will have used it despite the underscore prefix, but a quick google search for "F._is_tensor_image" suggests this is rare). * Value checking to prevent division by zero runtime crashes. Added a ValueError to check for and avoid division by zero in `div_`. Not preventing the call leads to runtime crashes, at least in some environments. * Fixed div by zero check for non-scalar inputs.
-
- 29 Jan, 2020 1 commit
-
-
Francisco Massa authored
-
- 22 Jan, 2020 2 commits
-
-
Philip Meier authored
-
Philip Meier authored
* initial fix * outsourced num bands lookup * fix doc * added pillow version requirement * simplify number of bands extraction * remove unrelated change * remove indirect dependency on pillow>=5.2.0 * extend docstring to transform * bug fix * added test
-