Skip to content

How can I run the Orientation model solely to determine the page rotation angle? #1797

Answered by felixdittrich92
sanjay-nit asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @sanjay-nit 👋,

That's right our orientation prediction depends on the detection model:

  1. Estimate general page orientation -> [0, 90, 180, 270 (-90)]
  2. Correct the input
  3. Detect all text and get the segmentation map
  4. Estimate the "fine grained" orientation

Here is a short snippet how you could use it without the recognition part:

import requests
import numpy as np

from doctr.io import DocumentFile
from doctr.models import detection_predictor, page_orientation_predictor
from doctr.models._utils import estimate_orientation


url = "https://www.francetvinfo.fr/pictures/uGwaNE-aJq7zHLhZJdzdCd9nyjE/1200x900/2021/03/16/phpCDwGn0.jpg"

det_predictor = detection_predictor(
    arch="fast_base",
    

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@sanjay-nit
Comment options

Answer selected by sanjay-nit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants