1. 01 Dec, 2020 3 commits
  2. 30 Nov, 2020 2 commits
  3. 27 Nov, 2020 5 commits
  4. 26 Nov, 2020 1 commit
  5. 20 Nov, 2020 2 commits
    • Alexey Demyanchuk's avatar
      Add explicit check for number of channels (#3013) · a51c49e4
      Alexey Demyanchuk authored
      
      
      * Add explicit check for number of channels
      
      Example why you need to check it:
      `M = torch.randint(low=0, high=2, size=(6, 64, 64), dtype = torch.float)`
      When you put this input through to_pil_image without mode argument, it converts to uint8 here:
      ```
      if pic.is_floating_point() and mode != 'F':
                  pic = pic.mul(255).byte()
      ```
      and change the mode to RGB here:
      ```
      if mode is None and npimg.dtype == np.uint8:
                  mode = 'RGB'
      ```
      Image.fromarray doesn't raise if provided with mode RGB and just cut number of channels from what you have to 3
      
      * Check number of channels before processing
      
      * Add test for invalid number of channels
      
      * Add explicit check for number of channels
      
      Example why you need to check it:
      `M = torch.randint(low=0, high=2, size=(6, 64, 64), dtype = torch.float)`
      When you put this input through to_pil_image without mode argument, it converts to uint8 here:
      ```
      if pic.is_floating_point() and mode != 'F':
                  pic = pic.mul(255).byte()
      ```
      and change the mode to RGB here:
      ```
      if mode is None and npimg.dtype == np.uint8:
                  mode = 'RGB'
      ```
      Image.fromarray doesn't raise if provided with mode RGB and just cut number of channels from what you have to 3
      
      * Check number of channels before processing
      
      * Add test for invalid number of channels
      
      * Put check after channel dim unsqueeze
      
      * Add test if error message is matching
      
      * Delete redundant code
      
      * Bug fix in checking for bad types
      Co-authored-by: default avatarDemyanchuk <demyanca@mh-hannover.local>
      Co-authored-by: default avatarvfdev <vfdev.5@gmail.com>
      a51c49e4
    • Philip Meier's avatar
  6. 19 Nov, 2020 3 commits
  7. 18 Nov, 2020 2 commits
    • Vasilis Vryniotis's avatar
      8c281757
    • Vasilis Vryniotis's avatar
      Support specifying output channels in io.image.read_image (#2988) · 4d6ba678
      Vasilis Vryniotis authored
      * Adding output channels implementation for pngs.
      
      * Adding tests for png.
      
      * Adding channels in the API and documentation.
      
      * Fixing formatting.
      
      * Refactoring test_image.py to remove huge grace_hopper_517x606.pth file from assets and reduce duplicate code. Moving jpeg assets used by encode and write unit-tests on their separate folders.
      
      * Adding output channels implementation for jpegs. Fix asset locations.
      
      * Add tests for JPEG, adding the channels in the API and documentation and adding checks for inputs.
      
      * Changing folder for unit-test.
      
      * Fixing windows flakiness, removing duplicate test.
      
      * Replacing components to channels.
      
      * Adding reference for supporting CMYK.
      
      * Minor changes: num_components to output_components, adding comments, fixing variable name etc.
      
      * Reverting output_components to num_components.
      
      * Replacing decoding with generic method on tests.
      
      * Palette converted to Gray.
      4d6ba678
  8. 16 Nov, 2020 5 commits
  9. 10 Nov, 2020 2 commits
  10. 09 Nov, 2020 5 commits
  11. 06 Nov, 2020 5 commits
  12. 04 Nov, 2020 1 commit
    • peterjc123's avatar
      Make read_file and write_file accept unicode strings on Windows (#2949) · f5c0bfa5
      peterjc123 authored
      * Make read_file accept unicode strings on Windows
      
      * More fixes
      
      * Remove definitions from source files
      
      * Move string definitions to header
      
      * Add checks
      
      * Fix comments
      
      * Update macro
      
      * Fix comments
      
      * Fix lint
      
      * include windows header
      
      * Change func signature in header
      
      * Use from_blob
      
      * Fix fread calls
      
      * Fix clang format
      
      * Fix missing return
      
      * Avoid copy
      f5c0bfa5
  13. 03 Nov, 2020 2 commits
  14. 02 Nov, 2020 1 commit
  15. 30 Oct, 2020 1 commit