-
Notifications
You must be signed in to change notification settings - Fork 27.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fast image processor #28847
Merged
amyeroberts
merged 40 commits into
huggingface:main
from
amyeroberts:fast-image-processor
Jun 11, 2024
Merged
Fast image processor #28847
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
68a1e75
Draft fast image processors
amyeroberts dbf9959
Draft working fast version
amyeroberts 3632cf7
py3.8 compatible cache
amyeroberts 49196c8
Enable loading fast image processors through auto
amyeroberts 6fc2901
Tidy up; rescale behaviour based on input type
amyeroberts 834ae6a
Enable tests for fast image processors
amyeroberts 6d5c328
Smarter rescaling
amyeroberts eb701c1
Don't default to Fast
amyeroberts 415be88
Safer imports
amyeroberts fb89515
Add necessary Pillow requirement
amyeroberts d2eb99f
Woops
amyeroberts fc1530e
Add AutoImageProcessor test
amyeroberts a3f6d02
Fix up
amyeroberts e0bd18d
Fix test for imagegpt
amyeroberts 8c4761a
Fix test
amyeroberts 687da88
Review comments
amyeroberts fc1e121
Add warning for TF and JAX input types
amyeroberts 1077938
Rearrange
amyeroberts 5cb11df
Return transforms
amyeroberts fff70c3
NumpyToTensor transformation
amyeroberts 8b09622
Rebase - include changes from upstream in ImageProcessingMixin
amyeroberts 8d82609
Safe typing
amyeroberts 849e27b
Fix up
amyeroberts fdd4e5d
convert mean/std to tesnor to rescale
amyeroberts 0ad7e71
Don't store transforms in state
amyeroberts 1b5885b
Fix up
amyeroberts e29150c
Update src/transformers/image_processing_utils_fast.py
amyeroberts a1f718b
Update src/transformers/models/auto/image_processing_auto.py
amyeroberts af52ee2
Update src/transformers/models/auto/image_processing_auto.py
amyeroberts 34b8859
Update src/transformers/models/auto/image_processing_auto.py
amyeroberts 5e7a30d
Warn if fast image processor available
amyeroberts 2d75607
Update src/transformers/models/vit/image_processing_vit_fast.py
amyeroberts a43cabc
Transpose incoming numpy images to be in CHW format
amyeroberts 6acf27f
Update mapping names based on packages, auto set fast to None
amyeroberts a38d3ee
Fix up
amyeroberts 942286f
Fix
amyeroberts 954ee20
Add AutoImageProcessor.from_pretrained(checkpoint, use_fast=True) test
amyeroberts ee06a6a
Update src/transformers/models/vit/image_processing_vit_fast.py
amyeroberts 1d1d416
Add equivalence and speed tests
amyeroberts d598b5a
Fix up
amyeroberts File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,3 +29,4 @@ timm | |
albumentations >= 1.4.5 | ||
torchmetrics | ||
pycocotools | ||
Pillow>=10.0.1,<=15.0 | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, why 15.0 here? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a security thing :) It matches the pin we have in setup.py which was set in #27409