You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Earlier I had written a whole module which uses pdf2image to extract page image and run DocTR to find the orientation of the image. Later I realized that it's not the problem of DocTR but OnnxTR which I was using earlier.
I want to report a strange case where for the same image DocTR gives correct orientation of 0 as the image is vertical, while OnnxTR gives 180degree orientation.
Here's the image:
Code snippet to reproduce the bug
import os
import json
from doctr.io import DocumentFile
from doctr.models import ocr_predictor
# from onnxtr.io import DocumentFile
# from onnxtr.models import ocr_predictor
os.environ['USE_TORCH'] = '1'
img_path = "extracted_image/abc6_page_1.png"
predictor = ocr_predictor(
det_arch="db_resnet50",
reco_arch="crnn_mobilenet_v3_large",
resolve_blocks=True,
resolve_lines=True,
paragraph_break=0.035,
assume_straight_pages=False,
detect_orientation=True,
)
doc = DocumentFile.from_images(img_path)
result = predictor(doc)
text_data = result.render()
json_data = result.export()
print(json_data)
parsed_file = f"doctr-output.txt"
with open(parsed_file, "w") as f:
f.write(text_data)
The text was updated successfully, but these errors were encountered:
felixdittrich92
changed the title
[orientation classification]
[orientation classification] Result differs from docTR
Dec 6, 2024
Bug description
Ref.: mindee/doctr#1801
Earlier I had written a whole module which uses pdf2image to extract page image and run DocTR to find the orientation of the image. Later I realized that it's not the problem of DocTR but OnnxTR which I was using earlier.
I want to report a strange case where for the same image DocTR gives correct orientation of 0 as the image is vertical, while OnnxTR gives 180degree orientation.
Here's the image:
Code snippet to reproduce the bug
The text was updated successfully, but these errors were encountered: