1. 03 Aug, 2023 1 commit
  2. 26 Jan, 2023 1 commit
  3. 17 Oct, 2022 1 commit
  4. 12 Oct, 2022 1 commit
  5. 17 Aug, 2022 1 commit
    • amyeroberts's avatar
      Update feature extractor methods to enable type cast before normalize (#18499) · 49e44b21
      amyeroberts authored
      * Update methods to optionally rescale
      This is necessary to allow for casting our images / videos to numpy arrays within the feature extractors' call. We want to do this to make sure the behaviour is as expected when flags like  are False. If some transformations aren't applied, then the output type can't be unexpected e.g. a list of PIL images instead of numpy arrays.
      
      * Cast images to numpy arrays in call to enable consistent behaviour with different configs
      
      * Remove accidental clip changes
      
      * Update tests to reflect the scaling logic
      We write a generic  function to handle rescaling of our arrays. In order for the API to be intuitive, we take some factor c and rescale the image values by that. This means, the rescaling done in normalize and to_numpy_array are now done with array * (1/255) instead of array / 255. This leads to small differences in the resulting image. When testing, this was in the order of 1e-8, and so deemed OK
      49e44b21
  6. 23 Feb, 2022 1 commit
  7. 02 Feb, 2022 1 commit
  8. 03 Nov, 2021 1 commit
  9. 05 Apr, 2021 1 commit
  10. 01 Apr, 2021 1 commit
    • NielsRogge's avatar
      Add Vision Transformer and ViTFeatureExtractor (#10950) · 30677dc7
      NielsRogge authored
      
      
      * Squash all commits into one
      
      * Update ViTFeatureExtractor to use image_utils instead of torchvision
      
      * Remove torchvision and add Pillow
      
      * Small docs improvement
      
      * Address most comments by @sgugger
      
      * Fix tests
      
      * Clean up conversion script
      
      * Pooler first draft
      
      * Fix quality
      
      * Improve conversion script
      
      * Make style and quality
      
      * Make fix-copies
      
      * Minor docs improvements
      
      * Should use fix-copies instead of manual handling
      
      * Revert "Should use fix-copies instead of manual handling"
      
      This reverts commit fd4e591bce4496d41406425c82606a8fdaf8a50b.
      
      * Place ViT in alphabetical order
      Co-authored-by: default avatarLysandre <lysandre.debut@reseau.eseo.fr>
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      30677dc7
  11. 26 Mar, 2021 1 commit