Skip to content

How to get rotate angle #961

Answered by zaferguler87
zaferguler87 asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for your inspiring comments.

You can find the basic code block below.

from doctr.io import DocumentFile
from doctr.models import ocr_predictor

doc = DocumentFile.from_images("bill/11.jpeg")
predictor = ocr_predictor(pretrained=True, assume_straight_pages=False, det_arch='db_resnet50_rotation', export_as_straight_boxes=False, preserve_aspect_ratio=True)
result = predictor(doc)

result.show(doc)

json_export = result.export()
print(json_export)

After changing the export_as_straight_boxes variable to False I noticed that in my case each word is represented as a 4-point polygon as seen below.


In addition, the points for each word come in clockwise order. Therefore, with a little an…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@frgfm
Comment options

@zaferguler87
Comment options

Answer selected by zaferguler87
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
module: models Related to doctr.models topic: text detection Related to the task of text detection
2 participants