1. 11 Jun, 2020 1 commit
    • Philip Meier's avatar
      Add convert_image_dtype to functionals (#2078) · c2e8a008
      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: default avatarPhilip Meier <meier.philip@posteo.de>
      c2e8a008
  2. 10 Jun, 2020 1 commit
  3. 04 Jun, 2020 1 commit
  4. 18 May, 2020 2 commits
    • Steven Basart's avatar
      Add pil_to_tensor to functionals (#2092) · e6d3f8c5
      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.
      e6d3f8c5
    • Francisco Massa's avatar
      Fix Python lint (#2226) · e2e511be
      Francisco Massa authored
      e2e511be
  5. 05 May, 2020 1 commit
  6. 02 Apr, 2020 1 commit
  7. 01 Apr, 2020 1 commit
  8. 31 Mar, 2020 1 commit
  9. 24 Mar, 2020 1 commit
  10. 23 Mar, 2020 1 commit
    • Willie Maddox's avatar
      Add Perspective fill option (#1973) · 91b44590
      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.
      91b44590
  11. 10 Feb, 2020 1 commit
  12. 27 Jan, 2020 1 commit
    • abdjava's avatar
      Fixed typo in comments (#1784) · 035ed162
      abdjava authored
      I have fixed a typo that was persent in the Normalize class changed line 150 from     ``input[channel] = (input[channel] - mean[channel]) / std[channel]`` to     ``output[channel] = (input[channel] - mean[channel]) / std[channel]``
      035ed162
  13. 22 Jan, 2020 1 commit
    • Philip Meier's avatar
      Fix fill in rotate (#1760) · 8f4f8d89
      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
      8f4f8d89
  14. 24 Sep, 2019 1 commit
    • Zhicheng Yan's avatar
      Video transforms (#1353) · 64917bcc
      Zhicheng Yan authored
      * video transforms
      
      * [video transforms]in ToTensorVideo, divide value by 255.0
      
      * [video transforms] fix a bug
      
      * fix linting
      
      * Make changes backwards-compatible
      64917bcc
  15. 11 Sep, 2019 1 commit
  16. 30 Aug, 2019 1 commit
  17. 06 Jul, 2019 1 commit
    • Zhun Zhong's avatar
      Fix bug to RandomErasing (#1095) · 34833427
      Zhun Zhong authored
      * Fix bug to Random Erasing
      
      1. Avoid forever loop for getting parameters of erase.
      2. replace' img_b' by 'img_c', because it indicates the channel.
      3. replace v = torch.rand([img_c, h, w]) by v = torch.empty([img_c, h, w], dtype=torch.float32).normal_(). Normally distributed achieves better performance.
      
      * add test
      
      * Update test_transforms.py
      
      * Update transforms.py
      
      * Update test_transforms.py
      
      * Update transforms.py
      
      * Update functional.py
      34833427
  18. 04 Jul, 2019 1 commit
    • ekka's avatar
      Minor optimization to RandomErasing (#1087) · 793c4e82
      ekka authored
      * Minor optimization to RandomErasing
      
      This PR adds an additional check on `p` argument and prevents computing `img.shape` multiple times.
      
      * linting
      793c4e82
  19. 03 Jul, 2019 1 commit
  20. 28 Jun, 2019 2 commits
  21. 24 Jun, 2019 1 commit
    • Zhun Zhong's avatar
      transforms: add Random Erasing for image augmentation (#909) · 3254560b
      Zhun Zhong authored
      * add erase function
      
      * add Random Erasing
      
      * Update transforms.py
      
      * Update transforms.py
      
      * add test for random erasing
      
      * Update test_transforms.py
      
      * fix flake8
      
      * Update test_transforms.py
      
      * Update functional.py
      
      * Update test_transforms.py
      
      * fix bug for per-pixel erasing
      
      * Update transforms.py
      
      * specific for coordinate (x, y)
      
      * add raise TypeError for img
      
      * Update transforms.py
      
      * Update transforms.rst
      3254560b
  22. 20 Jun, 2019 1 commit
  23. 05 Jun, 2019 1 commit
  24. 21 May, 2019 1 commit
  25. 06 May, 2019 1 commit
  26. 02 May, 2019 1 commit
  27. 25 Apr, 2019 1 commit
  28. 09 Apr, 2019 1 commit
  29. 25 Mar, 2019 1 commit
    • ekka's avatar
      Add AffineTransformation (#793) · c88d7fb5
      ekka authored
      * Add Affinetransformation
      
      Add Affinetransformation to superseed LinearTransformation
      
      * Add test
      
      * Add zero mean_vector in LinearTransformation and improved docs
      
      * update
      
      * minor fix
      
      * minor fix2
      
      * fixed flake8
      
      * fix flake8
      
      * fixed transpose syntax
      
      * fixed shape of mean_vector in test
      
      * fixed test
      
      * print est cov and mean
      
      * fixed flake8
      
      * debug
      
      * reduce num_samples
      
      * debug
      
      * fixed num_features
      
      * fixed rtol for cov
      
      * fix __repr__
      
      * Update transforms.py
      
      * Update test_transforms.py
      
      * Update transforms.py
      
      * fix flake8
      
      * Update transforms.py
      
      * Update transforms.py
      
      * Update transforms.py
      
      * Update transforms.py
      
      * Changed dim of mean_vector to 1D, doc and removed .numpy () from format_string
      
      * Restore test_linear_transformation()
      
      * Update test_transforms.py
      c88d7fb5
  30. 20 Mar, 2019 1 commit
  31. 11 Mar, 2019 2 commits
  32. 18 Feb, 2019 1 commit
  33. 08 Jan, 2019 1 commit
    • surgan12's avatar
      Doc changes (#711) · 8f0ef5a7
      surgan12 authored
      * doc change
      
      * doc changes
      
      * lint_checks
      
      * Update transforms.py
      8f0ef5a7
  34. 30 Dec, 2018 1 commit
    • surgan12's avatar
      normalise updates (#699) · 21153802
      surgan12 authored
      * normalise
      
      * some changes
      
      * Update functional.py
      
      * Update functional.py
      
      * code changes
      21153802
  35. 20 Dec, 2018 1 commit
  36. 18 Dec, 2018 1 commit
  37. 26 Oct, 2018 1 commit