How to get or see the re-constructed page for a given input ? #446
Answered
by
fg-mindee
PrasannaVpk
asked this question in
Q&A
-
I want to see the result of page-constructed image,how to get that ? |
Beta Was this translation helpful? Give feedback.
Answered by
fg-mindee
Aug 29, 2021
Replies: 1 comment 1 reply
-
Hi @PrasannaVpk 👋 If you mean the image synthesized from the model predictions, here is a snippet: import matplotlib.pyplot as plt
from doctr.io import DocumentFile
from doctr.models import ocr_predictor
from doctr.utils.visualization import synthetize_page
model = ocr_predictor(pretrained=True)
# PDF
doc = DocumentFile.from_pdf("path/to/your/doc.pdf").as_images()
# Analyze
result = model(doc)
# Reconstructed the first page of the document
img = synthetize_page(result.pages[0].export())
plt.imshow(img); plt.show() Hope this helps :) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
PrasannaVpk
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @PrasannaVpk 👋
If you mean the image synthesized from the model predictions, here is a snippet:
which yields:
Hope this helps :)
If I misunderstood you, please specify what you meant so that we can assist you 👌