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

feat: Added high-level predictors #39

Merged
merged 15 commits into from
Jan 27, 2021
Merged

feat: Added high-level predictors #39

merged 15 commits into from
Jan 27, 2021

Conversation

fg-mindee
Copy link
Contributor

This PR introduces the following modifications:

  • created DetectionPredictor that takes a list of images as inputs and returns a list of tensors, where each tensor represents all the detected bounding boxes in the image
  • fixed edge case of cropping when no bounding box was passed
  • created RecognitionPredictor that takes a list of image crops as inputs and returns a list of character sequences for each crop
  • created OCRPredictor that takes a list of lists of images as inputs, and returns the localization + recognition results in a structured hierarchical output
  • updated all unittests accordingly

Please note that for now, the OCRPredictor returns a structured output but does not use the elements defined in the module doct.documents

Successfully merging this PR will close #3 and close #4

Any feedback is welcome!

@fg-mindee fg-mindee added type: enhancement Improvement module: models Related to doctr.models ext: tests Related to tests folder labels Jan 26, 2021
@fg-mindee fg-mindee added this to the 0.1.0 milestone Jan 26, 2021
@fg-mindee fg-mindee self-assigned this Jan 26, 2021
@codecov
Copy link

codecov bot commented Jan 26, 2021

Codecov Report

Merging #39 (7d2f85c) into main (73b43dd) will decrease coverage by 0.11%.
The diff coverage is 96.96%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #39      +/-   ##
==========================================
- Coverage   97.86%   97.75%   -0.12%     
==========================================
  Files          19       20       +1     
  Lines         469      534      +65     
==========================================
+ Hits          459      522      +63     
- Misses         10       12       +2     
Impacted Files Coverage Δ
doctr/models/recognition/__init__.py 100.00% <ø> (ø)
doctr/models/recognition/crnn.py 100.00% <ø> (ø)
doctr/models/core.py 94.44% <94.44%> (ø)
doctr/models/recognition/core.py 92.59% <94.73%> (+2.59%) ⬆️
doctr/models/__init__.py 100.00% <100.00%> (ø)
doctr/models/_utils.py 92.85% <100.00%> (ø)
doctr/models/detection/core.py 93.33% <100.00%> (+4.44%) ⬆️
...tr/models/detection/differentiable_binarization.py 98.18% <100.00%> (-0.05%) ⬇️
doctr/models/preprocessor.py 100.00% <100.00%> (+3.44%) ⬆️
doctr/models/recognition/postprocessor.py 94.59% <100.00%> (+0.15%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 73b43dd...7d2f85c. Read the comment docs.

doctr/models/core.py Show resolved Hide resolved
doctr/models/detection/core.py Show resolved Hide resolved
doctr/models/detection/core.py Show resolved Hide resolved
@fg-mindee fg-mindee merged commit 3868d9e into main Jan 27, 2021
@fg-mindee fg-mindee deleted the predictor branch January 27, 2021 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ext: tests Related to tests folder module: models Related to doctr.models type: enhancement Improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[models] Add text recognition module [models] Add detection module
2 participants