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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ViT as classification model TF and PT #1050

Merged
merged 11 commits into from
Sep 9, 2022

Conversation

felixdittrich92
Copy link
Contributor

@felixdittrich92 felixdittrich92 commented Sep 7, 2022

This PR:

  • adds ViT as classification model, which can be used as backbone for ViTSTR/ParSeq

Any feedback or ideas for improvements are very welcome 馃

validated via test runs both models trains well

@codecov
Copy link

codecov bot commented Sep 7, 2022

Codecov Report

Merging #1050 (806494f) into main (1cc073d) will increase coverage by 0.09%.
The diff coverage is 98.95%.

@@            Coverage Diff             @@
##             main    #1050      +/-   ##
==========================================
+ Coverage   94.94%   95.03%   +0.09%     
==========================================
  Files         135      141       +6     
  Lines        5634     5818     +184     
==========================================
+ Hits         5349     5529     +180     
- Misses        285      289       +4     
Flag Coverage 螖
unittests 95.03% <98.95%> (+0.09%) 猬嗭笍

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage 螖
doctr/models/classification/zoo.py 100.00% <酶> (酶)
doctr/models/classification/vit/pytorch.py 97.50% <97.50%> (酶)
doctr/models/classification/vit/tensorflow.py 97.82% <97.82%> (酶)
doctr/models/classification/__init__.py 100.00% <100.00%> (酶)
doctr/models/classification/vit/__init__.py 100.00% <100.00%> (酶)
doctr/models/modules/__init__.py 100.00% <100.00%> (酶)
doctr/models/modules/transformer/pytorch.py 100.00% <100.00%> (酶)
doctr/models/modules/transformer/tensorflow.py 98.98% <100.00%> (+0.23%) 猬嗭笍
...octr/models/modules/vision_transformer/__init__.py 100.00% <100.00%> (酶)
doctr/models/modules/vision_transformer/pytorch.py 100.00% <100.00%> (酶)
... and 2 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@felixdittrich92 felixdittrich92 changed the title [DRAFT] Option 2 ViT [DRAFT] add ViT as classification model TF and PT Sep 8, 2022
@felixdittrich92 felixdittrich92 self-assigned this Sep 8, 2022
@felixdittrich92 felixdittrich92 added module: models Related to doctr.models framework: pytorch Related to PyTorch backend framework: tensorflow Related to TensorFlow backend topic: character classification Related to the task of character classification type: new feature New feature labels Sep 8, 2022
@felixdittrich92 felixdittrich92 linked an issue Sep 8, 2022 that may be closed by this pull request
85 tasks
@felixdittrich92 felixdittrich92 removed a link to an issue Sep 8, 2022
85 tasks
@felixdittrich92 felixdittrich92 added this to the 0.6.0 milestone Sep 8, 2022
@felixdittrich92 felixdittrich92 changed the title [DRAFT] add ViT as classification model TF and PT add ViT as classification model TF and PT Sep 8, 2022
@felixdittrich92 felixdittrich92 marked this pull request as ready for review September 8, 2022 12:01
Copy link
Collaborator

@odulcy-mindee odulcy-mindee left a comment

Choose a reason for hiding this comment

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

Really cool, thanks @felixdittrich92 ! 馃憦 馃殌

@felixdittrich92
Copy link
Contributor Author

Really cool, thanks @felixdittrich92 ! clap rocket

yeah now we can continue with ViTSTR and ParSeq 馃

@felixdittrich92 felixdittrich92 merged commit 05f5777 into mindee:main Sep 9, 2022
@felixdittrich92 felixdittrich92 deleted the vit-classification branch September 9, 2022 12:26
@felixdittrich92
Copy link
Contributor Author

@frgfm late review maybe ? 馃槄

Copy link
Collaborator

@frgfm frgfm left a comment

Choose a reason for hiding this comment

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

Thanks Felix! Looks good, I added a few comments :)

docs/source/modules/models.rst Show resolved Hide resolved
doctr/models/classification/vit/pytorch.py Show resolved Hide resolved
doctr/models/classification/vit/pytorch.py Show resolved Hide resolved
doctr/models/modules/transformer/pytorch.py Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
framework: pytorch Related to PyTorch backend framework: tensorflow Related to TensorFlow backend module: models Related to doctr.models topic: character classification Related to the task of character classification type: new feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants