1. 05 Oct, 2020 1 commit
    • Brian Vaughan's avatar
      make convert_image_dtype scriptable (#2485) · c542137c
      Brian Vaughan authored
      
      
      * make convert_image_dtype scriptable
      
      * move convert dtype to functional_tensor since only works on tensors
      
      * retain availability of convert_image_dtype in functional.py
      
      * Update code and tests
      
      * Replaced int by torch.dtype
      
      * int -> torch.dtype and use F instead of F_t
      
      * Update functional_tensor.py
      Co-authored-by: default avatarvfdev-5 <vfdev.5@gmail.com>
      c542137c
  2. 18 Sep, 2020 1 commit
    • vfdev's avatar
      Added tests on batch of tensors to check transforms (#2584) · c4dcfb06
      vfdev authored
      * [WIP] Added tests on batch of tensors
      
      * Updated tests on batch of images
      
      * All functional transforms can work with (..., C, H, W) format
      
      * Added transforms tests on batch tensors
      
      * Added batch tests for five/ten crop
      - updated docs
      c4dcfb06
  3. 14 Sep, 2020 1 commit
  4. 03 Sep, 2020 1 commit
    • Dragos Cristian's avatar
      adjust_hue now supports inputs of type Tensor (#2566) · bb88c452
      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: default avatarvfdev-5 <vfdev.5@gmail.com>
      bb88c452
  5. 02 Sep, 2020 1 commit
  6. 01 Sep, 2020 1 commit
    • vfdev's avatar
      Refactor adjust ops tests (#2595) · 5f616a2b
      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
      
      * Rewritten adjust_* tests
      - split test_adjustments into 3 separate tests
      - unified testing approach with test_adjust_gamma
      
      * Added ColorJitter tests
      
      * Relaxed tolerance for functional adjust-* tests
      
      * Removed wrong merge and commented code
      5f616a2b
  7. 31 Aug, 2020 1 commit
  8. 28 Aug, 2020 1 commit
    • vfdev's avatar
      Unified inputs for grayscale ops and transforms (#2586) · 2eba1f04
      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
      2eba1f04
  9. 26 Aug, 2020 1 commit
  10. 20 Aug, 2020 1 commit
  11. 11 Aug, 2020 1 commit
  12. 08 Aug, 2020 1 commit
  13. 07 Aug, 2020 1 commit
    • vfdev's avatar
      [BC-breaking] Unified input for F.perspective (#2558) · 8c7e7bb0
      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
      8c7e7bb0
  14. 06 Aug, 2020 1 commit
    • vfdev's avatar
      Fixes F.affine and F.rotate to support rectangular tensor images (#2553) · 025b71d8
      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
      025b71d8
  15. 05 Aug, 2020 1 commit
    • vfdev's avatar
      Unified inputs for `F.rotate` (#2495) · 76662528
      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
      76662528
  16. 03 Aug, 2020 1 commit
  17. 17 Jul, 2020 1 commit
  18. 16 Jul, 2020 2 commits
    • Kushajveer Singh's avatar
      perform cyclic check for hue in test_rgb2hsv (#2477) · ab73b448
      Kushajveer Singh authored
      * perform cyclic check for hue in test_rgb2hsv
      
      Test fails for cases when hue=0 and hue=360. As hue is cyclic in nature, add cyclic logic for checking the max difference by taking the sin of the tensor and then comparing the max values.
      
      * address linter issues
      ab73b448
    • vfdev's avatar
      Unified input for F.affine (#2444) · 5f4b5794
      vfdev authored
      * [WIP] F.affine
      
      * [WIP] F.affine + tests
      
      * Unified input for F.affine
      
      * Removed commented code
      
      * Removed unused imports
      5f4b5794
  19. 10 Jul, 2020 1 commit
  20. 07 Jul, 2020 1 commit
    • vfdev's avatar
      Unified input for resized crop op (#2396) · 9b804659
      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
      9b804659
  21. 06 Jul, 2020 1 commit
    • vfdev's avatar
      Unified input for resize op (#2394) · e212cc86
      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
      e212cc86
  22. 02 Jul, 2020 1 commit
    • vfdev's avatar
      Added symmetric padding mode for Tensors (#2373) · 39e4057c
      vfdev authored
      * [WIP] Added symmetric padding mode
      
      * Added check and raise error if padding is negative for symmetric padding mode
      
      * Added test check for raising error if negative pad
      39e4057c
  23. 30 Jun, 2020 1 commit
  24. 26 Jun, 2020 1 commit
  25. 11 Jun, 2020 1 commit
  26. 10 Jun, 2020 1 commit
  27. 31 Mar, 2020 1 commit
  28. 19 Dec, 2019 1 commit
  29. 12 Dec, 2019 1 commit
  30. 04 Dec, 2019 1 commit
  31. 05 Nov, 2019 1 commit
    • Ankit Jha's avatar
      [WIP] Add Scriptable Transform: Grayscale (#1505) · 8909ff43
      Ankit Jha authored
      * Add Scriptable Transform: Grayscale
      
      * add scriptable transforms: rgb_to_grayscale
      
      * add scriptable transform: rgb_to_grayscale
      
      * add scriptable transform: rgb_to_grayscale
      
      * add scriptable transform: rgb_to_grayscale
      
      * update code: rgb_to_grayscale
      
      * add test: rgb_to_grayscale
      
      * update parameters: rgb_to_grayscale
      
      * add scriptable transform: rgb_to_grayscale
      
      * update rgb_to_grayscale
      
      * update rgb_to_grayscale
      8909ff43
  32. 26 Oct, 2019 1 commit
    • pedrofreire's avatar
      Add adjustment operations for RGB Tensor Images. (#1525) · e79caddf
      pedrofreire authored
      * Add adjustment operations for RGB Tensor Images.
      
      Right now, we have operations on PIL images, but we want to have a version of the opeartions that act directly on Tensor images.
      
      Here, we add such operations for adjust_brightness, adjust_contrast and adjust_saturation.
      
      In PIL, those functions are implemented by generating an degenerate image from the first, and then interpolating them together.
      - https://github.com/python-pillow/Pillow/blob/master/src/PIL/ImageEnhance.py
      - https://github.com/python-pillow/Pillow/blob/master/src/libImaging/Blend.c
      
      A few caveats:
      * Since PIL operates on uint8, and the tensor operations might be on float, we can get slightly different values because of int truncation.
      * We assume here the images are RGB; in particular, to handle an alpha channel, we need to check whether it is present, in which case we copy it to the final image.
      
      * Keep dtype and use broadcast in adjust operations
      
      - We make our operations have input.dtype == output.dtype, at the cost of
      adding a few type checks and branches.
      
      - By using Tensor broadcast, we can simplify the calls to _blend.
      
      * Use is_floating_point to check dtype.
      
      * Remove unpacking in tuple
      
      It seems Python 2 does not support this type of unpacking, so it broke
      Python 2 builds. This should fix it.
      
      * Add from __future__ import division for Python 2
      e79caddf
  33. 18 Oct, 2019 1 commit
    • ekka's avatar
      Make crop scriptable (#1379) · d194082c
      ekka authored
      * Make crop torchscriptable
      
      Relevant #1375
      
      * Invert x and y axis
      
      * fix lint
      
      * Add crop test
      
      * revert deletion of space in functional
      
      * add import random
      
      * add dimension in doc
      
      * add import
      
      * fix flake8
      
      * change to self.assert*
      
      * convert to uint8
      
      * assertTrue
      
      * lint
      d194082c
  34. 16 Oct, 2019 1 commit