Skip to content

Conversation

@charlesmindee
Copy link
Collaborator

Debug end to end OCRPredictor, this kind of script is now functional:

docs = [doctr.documents.reader.read_pdf(...)]

predictor = models.OCRPredictor(
    models.DetectionPredictor(
        ...
    ),
    models.RecognitionPredictor(
        ...
    )
)
predictor.det_predictor.model.load_weights('./checkpointsdet/weights')
predictor.reco_predictor.model.load_weights('./checkpointsreco/weights')

out = predictor(docs)

for doc in docs:
    for i, page in enumerate(doc.pages):
        visualize_page(page, image=docs[i])

Copy link
Contributor

@fg-mindee fg-mindee left a comment

Choose a reason for hiding this comment

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

Not exactly sure where the failure comes from, I added a few comments!

@fg-mindee fg-mindee added the module: models Related to doctr.models label Feb 4, 2021
@fg-mindee fg-mindee added this to the 0.1.0 milestone Feb 4, 2021
@fg-mindee fg-mindee added the critical High priority label Feb 4, 2021
@codecov
Copy link

codecov bot commented Feb 4, 2021

Codecov Report

Merging #58 (e2fbbb3) into main (e3886ac) will decrease coverage by 0.68%.
The diff coverage is 84.61%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #58      +/-   ##
==========================================
- Coverage   92.24%   91.56%   -0.69%     
==========================================
  Files          22       22              
  Lines         735      735              
==========================================
- Hits          678      673       -5     
- Misses         57       62       +5     
Impacted Files Coverage Δ
doctr/models/core.py 78.84% <0.00%> (-7.70%) ⬇️
...tr/models/detection/differentiable_binarization.py 97.43% <87.50%> (-0.86%) ⬇️
doctr/models/detection/core.py 93.93% <100.00%> (ø)
doctr/models/preprocessor.py 96.66% <100.00%> (ø)
doctr/models/recognition/core.py 94.73% <100.00%> (ø)

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 e3886ac...e2fbbb3. Read the comment docs.

Copy link
Contributor

@fg-mindee fg-mindee left a comment

Choose a reason for hiding this comment

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

Thanks for the edits!

@charlesmindee charlesmindee merged commit fb7ecaa into main Feb 4, 2021
@charlesmindee charlesmindee deleted the debug_ocr branch February 4, 2021 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

critical High priority module: models Related to doctr.models

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants