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

docs: fix faulty code for prediction and recognition demos #1800

Conversation

khanfarhan10
Copy link
Contributor

fix faulty code for prediction and recognition demos

fix faulty code for prediction and recognition demos
@khanfarhan10
Copy link
Contributor Author

Looks like a minor bug @felixdittrich92 , kindly merge if looks okay to you!

Amazing OCR guys, Open Source all the way!

@khanfarhan10
Copy link
Contributor Author

khanfarhan10 commented Nov 29, 2024

Hmm, not sure on the CI/CD breaking though. It just states it's an internal github actions error, can someone from the docTR team, please trigger a re-run for the failing job?

@felixdittrich92 felixdittrich92 self-assigned this Nov 29, 2024
@felixdittrich92 felixdittrich92 added this to the 0.11.0 milestone Nov 29, 2024
@felixdittrich92 felixdittrich92 added topic: documentation Improvements or additions to documentation type: enhancement Improvement ext: docs Related to docs folder labels Nov 29, 2024
@felixdittrich92 felixdittrich92 self-requested a review November 29, 2024 22:44
Copy link
Contributor

@felixdittrich92 felixdittrich92 left a comment

Choose a reason for hiding this comment

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

Hi @khanfarhan10 👋🏼,

Thanks for the PR 👍
Only a small comment to clearify before merging :)

dummy_img = (255 * np.random.rand(800, 600, 3)).astype(np.uint8)
out = model([dummy_img])

You can pass specific boolean arguments to the predictor:

* `pretrained`: if you want to use a model that has been pretrained on a specific dataset, this will load the corresponding weights to enhance the model's performance.
Copy link
Contributor

Choose a reason for hiding this comment

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

@khanfarhan10 I think we should drop to enhance the model's performance sounds a bit missleading because otherwise it's random init and will lead to no or useless results ^^ wdyt ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Modified to the following:

pretrained: if you want to use a model that has been pretrained on a specific dataset, setting pretrained=True this will load the corresponding weights. If pretrained=False, which is the default, would otherwise lead to a random initialization and would lead to no/useless results.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@felixdittrich92 kindly have a re-look.

@felixdittrich92
Copy link
Contributor

Failing api test can be ignored i missed to replace the deprecated app=.. in the conftest 😅 will be fixed next week so can be ignored atm

Copy link

codecov bot commented Nov 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.60%. Comparing base (72bed41) to head (d7bcf94).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1800      +/-   ##
==========================================
+ Coverage   96.57%   96.60%   +0.02%     
==========================================
  Files         165      165              
  Lines        7892     7892              
==========================================
+ Hits         7622     7624       +2     
+ Misses        270      268       -2     
Flag Coverage Δ
unittests 96.60% <ø> (+0.02%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Minor pretrained argument description fixed
Copy link
Contributor

@felixdittrich92 felixdittrich92 left a comment

Choose a reason for hiding this comment

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

Thanks @khanfarhan10 🤗

@felixdittrich92 felixdittrich92 merged commit 2711df4 into mindee:main Nov 30, 2024
69 of 70 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ext: docs Related to docs folder topic: documentation Improvements or additions to documentation type: enhancement Improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants