Skip to content

Vision processors - replace FE with IPs #20590

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

Merged
merged 10 commits into from
Dec 9, 2022

Conversation

amyeroberts
Copy link
Collaborator

What does this PR do?

Replaces feature extractors with image processors in the Processor class which bundle together tokenizers and feature extractor.

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?

@amyeroberts amyeroberts changed the title Replace FE references with IPs Vision processors - replace FE with IPs Dec 5, 2022
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Dec 5, 2022

The documentation is not available anymore as the PR was closed or merged.

@amyeroberts amyeroberts force-pushed the replace-fe-ip-processor branch from d9d2f37 to 11542e6 Compare December 5, 2022 15:02
@amyeroberts amyeroberts marked this pull request as ready for review December 5, 2022 16:20
Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Just one comment on the deprecation warning to propagate to all processors.

amyeroberts and others added 6 commits December 7, 2022 16:22
@amyeroberts amyeroberts force-pushed the replace-fe-ip-processor branch from 021313a to c0f2c53 Compare December 7, 2022 16:22
@amyeroberts amyeroberts requested a review from ydshieh December 7, 2022 16:23
"`feature_extractor_class` is deprecated and will be removed in v5. Use `image_processor_class` instead.",
FutureWarning,
)
return self.image_processor_class
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also allow to give feature_extractor ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean adding a property feature_extractor too ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's a good point. I'll add that too.

Copy link
Collaborator Author

@amyeroberts amyeroberts Dec 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a feature_extractor property to all the processors. Let me know if that matches what you were thinking :)

@amyeroberts amyeroberts force-pushed the replace-fe-ip-processor branch from 155b2bd to ba853bc Compare December 8, 2022 21:47
Copy link
Collaborator

@ydshieh ydshieh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @amyeroberts !

@amyeroberts amyeroberts merged commit a95fd35 into huggingface:main Dec 9, 2022
@amyeroberts amyeroberts deleted the replace-fe-ip-processor branch December 9, 2022 10:48
mpierrau pushed a commit to mpierrau/transformers that referenced this pull request Dec 15, 2022
* Replace FE references with IPs

* Update processor tests

* Update src/transformers/models/clip/processing_clip.py

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>

* Update src/transformers/models/clip/processing_clip.py

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>

* Update warning messages v4.27 -> v5

* Fixup

* Update Chinese CLIP processor

* Add feature_extractor property

* Add attributes

* Add tests

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
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.

None yet

4 participants