1. 29 Jun, 2023 1 commit
  2. 31 May, 2023 1 commit
  3. 30 Mar, 2023 1 commit
  4. 14 Mar, 2023 1 commit
  5. 07 Mar, 2023 1 commit
  6. 02 Mar, 2023 1 commit
  7. 15 Dec, 2022 1 commit
  8. 13 Dec, 2022 1 commit
    • dhansmair's avatar
      in the resize() function in image_transforms.py, the line 267: (#20728) · 30d8919a
      dhansmair authored
      `image = to_channel_dimension_format(image, ChannelDimension.LAST)`
      is redundant as this same conversion is also applied in to_pil_image().
      
      This redundant call actually makes the training fail in rare cases.
      The problem can be reproduced with the following code snippet:
      ```
      from transformers.models.clip import CLIPFeatureExtractor
      vision_processor = CLIPFeatureExtractor.from_pretrained('openai/clip-vit-large-patch14')
      images = [
          torch.rand(size=(3, 2, 10), dtype=torch.float),
          torch.rand(size=(3, 10, 1), dtype=torch.float),
          torch.rand(size=(3, 1, 10), dtype=torch.float)
      ]
      for image in images:
          processed_image = vision_processor(images=image, return_tensors="pt")['pixel_values']
          print(processed_image.shape)
          assert processed_image.shape == torch.Size([1, 3, 224, 224])
      ```
      
      The last image has a height of 1 pixel.
      The second call to to_channel_dimesion_format() will transpose the image, and the height
      dimension is wrongly treated as the channels dimension afterwards.
      Because of this, the following normalize() step will result in an
      exception.
      30d8919a
  9. 12 Dec, 2022 1 commit
  10. 08 Dec, 2022 1 commit
    • amyeroberts's avatar
      Fix donut image processor (#20625) · cf1b8c34
      amyeroberts authored
      * fix donut image processor
      
      * Update test values
      
      * Apply lower bound on resizing size
      
      * Add in missing size param
      
      * Resolve resize channel_dimension bug
      
      * Update src/transformers/image_transforms.py
      cf1b8c34
  11. 29 Nov, 2022 1 commit
  12. 23 Nov, 2022 1 commit
  13. 18 Nov, 2022 1 commit
  14. 17 Nov, 2022 1 commit
  15. 15 Nov, 2022 1 commit
  16. 11 Nov, 2022 1 commit
  17. 02 Nov, 2022 1 commit
    • amyeroberts's avatar
      Add Image Processors (#19796) · a6b77598
      amyeroberts authored
      
      
      * Add CLIP image processor
      
      * Crop size as dict too
      
      * Update warning
      
      * Actually use logger this time
      
      * Normalize doesn't change dtype of input
      
      * Add perceiver image processor
      
      * Tidy up
      
      * Add DPT image processor
      
      * Add Vilt image processor
      
      * Tidy up
      
      * Add poolformer image processor
      
      * Tidy up
      
      * Add LayoutLM v2 and v3 imsge processors
      
      * Tidy up
      
      * Add Flava image processor
      
      * Tidy up
      
      * Add deit image processor
      
      * Tidy up
      
      * Add ConvNext image processor
      
      * Tidy up
      
      * Add levit image processor
      
      * Add segformer image processor
      
      * Add in post processing
      
      * Fix up
      
      * Add ImageGPT image processor
      
      * Fixup
      
      * Add mobilevit image processor
      
      * Tidy up
      
      * Add postprocessing
      
      * Fixup
      
      * Add VideoMAE image processor
      
      * Tidy up
      
      * Add ImageGPT image processor
      
      * Fixup
      
      * Add ViT image processor
      
      * Tidy up
      
      * Add beit image processor
      
      * Add mobilevit image processor
      
      * Tidy up
      
      * Add postprocessing
      
      * Fixup
      
      * Fix up
      
      * Fix flava and remove tree module
      
      * Fix image classification pipeline failing tests
      
      * Update feature extractor in trainer scripts
      
      * Update pad_if_smaller to accept tuple and int size
      
      * Update for image segmentation pipeline
      
      * Update src/transformers/models/perceiver/image_processing_perceiver.py
      Co-authored-by: default avatarAlara Dirik <8944735+alaradirik@users.noreply.github.com>
      
      * Update src/transformers/image_processing_utils.py
      Co-authored-by: default avatarNielsRogge <48327001+NielsRogge@users.noreply.github.com>
      
      * Update src/transformers/models/beit/image_processing_beit.py
      Co-authored-by: default avatarNielsRogge <48327001+NielsRogge@users.noreply.github.com>
      
      * PR comments - docstrings; remove accidentally added resize; var names
      
      * Update docstrings
      
      * Add exception if size is not in the right format
      
      * Fix exception check
      
      * Fix up
      
      * Use shortest_edge in tuple in script
      Co-authored-by: default avatarAlara Dirik <8944735+alaradirik@users.noreply.github.com>
      Co-authored-by: default avatarNielsRogge <48327001+NielsRogge@users.noreply.github.com>
      a6b77598
  18. 19 Oct, 2022 1 commit
  19. 18 Oct, 2022 1 commit
    • David Yang's avatar
      Clean up deprecation warnings (#19654) · a23819ed
      David Yang authored
      * Clean up deprecation warnings
      
      Notes:
      Changed some strings in tests to raw strings, which will change the literal content of the strings as they are fed into whatever machine handles them.
      Test cases for past in the past/past_key_values switch changed/removed due to warning of impending removal
      
      * Add PILImageResampling abstraction for PIL.Image.Resampling
      a23819ed
  20. 17 Oct, 2022 1 commit
  21. 12 Oct, 2022 1 commit