Update CvT documentation with improved usage examples and additional …#38731
Merged
stevhliu merged 6 commits intohuggingface:mainfrom Jun 17, 2025
Merged
Update CvT documentation with improved usage examples and additional …#38731stevhliu merged 6 commits intohuggingface:mainfrom
stevhliu merged 6 commits intohuggingface:mainfrom
Conversation
Member
|
cc @stevhliu |
stevhliu
reviewed
Jun 11, 2025
Member
stevhliu
left a comment
There was a problem hiding this comment.
Cool, thanks for your update!
Comment on lines
+26
to
+28
| # TODO: add information about CvT in simple language like Vit | ||
| Convolutional Vision Transformer (CvT) is a model that combines the strengths of convolutional neural networks (CNNs) and transformers for computer vision tasks. It introduces convolutional layers into the transformer architecture, allowing it to capture local patterns in images while maintaining the global context provided by self-attention mechanisms. | ||
| You can find all the CvT checkpoints under the [Microsoft](https://huggingface.co/microsoft?search_models=cvt) organization. |
Member
There was a problem hiding this comment.
Suggested change
| # TODO: add information about CvT in simple language like Vit | |
| Convolutional Vision Transformer (CvT) is a model that combines the strengths of convolutional neural networks (CNNs) and transformers for computer vision tasks. It introduces convolutional layers into the transformer architecture, allowing it to capture local patterns in images while maintaining the global context provided by self-attention mechanisms. | |
| You can find all the CvT checkpoints under the [Microsoft](https://huggingface.co/microsoft?search_models=cvt) organization. | |
| [Convolutional Vision Transformer (CvT)](https://huggingface.co/papers/2103.15808) is a model that combines the strengths of convolutional neural networks (CNNs) and transformers for computer vision tasks. It introduces convolutional layers into the transformer architecture, allowing it to capture local patterns in images while maintaining the global context provided by self-attention mechanisms. | |
| You can find all the original CvT checkpoints under the [Microsoft](https://huggingface.co/microsoft?search_models=cvt) organization. |
| - The original ViT demo notebooks, such as those found [here](https://github.com/NielsRogge/Transformers-Tutorials/tree/master/VisionTransformer), can often be adapted for CvT. You would typically replace ViT-specific classes like `ViTFeatureExtractor` with `AutoImageProcessor` and `ViTForImageClassification` with `CvtForImageClassification` or `AutoModelForImageClassification` using a CvT checkpoint. | ||
| - CvT checkpoints available on the Hugging Face Hub are often pre-trained on large-scale datasets like ImageNet-22k and may also be fine-tuned on datasets like ImageNet-1k. | ||
|
|
||
| ## Resources |
Member
There was a problem hiding this comment.
Remove the below and replace with:
Refer to this set of ViT [notebooks](https://github.com/NielsRogge/Transformers-Tutorials/tree/master/VisionTransformer) for examples of inference and fine-tuning on custom datasets. Replace [`ViTFeatureExtractor`] and [`ViTForImageClassification`] in these notebooks with [`AutoImageProcessor`] and [`CvtForImageClassification`].Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
stevhliu
approved these changes
Jun 17, 2025
Member
stevhliu
left a comment
There was a problem hiding this comment.
Thanks for your contribution! 🤗
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
…notes
What does this PR do?
Fixes # (issue)
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.