Skip to content
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

🚀 Speed up Image Processing for CV models #34432

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

yaswanth19
Copy link

@yaswanth19 yaswanth19 commented Oct 26, 2024

What does this PR do?

This speeds up image processing by converting the data to numpy array before sending to BatchFeature.

Queries:

  • Currently I am checking if all the images are of same size or not before converting the whole batch to ndarray; for that I am utilizing the arguments like do_resize,do_pad etc.. but is it necessary to do ti this way or we can write a helper function which checks whether every sub array is uniform or not and if so then convert the whole array to ndarray. WDYT?

Fixes #31205

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

@yonigozlan Please review this first draft PR where I have applied the logic only on some model and once approach is finalised, same changes would be made to all other models

@yaswanth19
Copy link
Author

@yonigozlan @amyeroberts A gentle ping to address my query so that I can implement it fully

@yaswanth19
Copy link
Author

@yonigozlan @amyeroberts A gentle ping again

@yaswanth19 yaswanth19 closed this Nov 29, 2024
@yaswanth19 yaswanth19 reopened this Dec 18, 2024
@yaswanth19 yaswanth19 marked this pull request as draft December 18, 2024 09:16
@yaswanth19
Copy link
Author

@amyeroberts @yonigozlan Please do a first review and address my query

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Speed up image processors - cast to array before BatchFeature
1 participant