class_docstr: Implements an object able to localize and identify text elements in a set of documents
  
  Args:
  ----
      det_predictor: detection module
      reco_predictor: recognition module
      assume_straight_pages: if True, speeds up the inference by assuming you only pass straight pages
          without rotated textual elements.
      straighten_pages: if True, estimates the page general orientation based on the median line orientation.
          Then, rotates page before passing it to the deep learning modules. The final predictions will be remapped
          accordingly. Doing so will improve performances for documents with page-uniform rotations.
      detect_orientation: if True, the estimated general page orientation will be added to the predictions for each
          page. Doing so will slightly deteriorate the overall latency.
      detect_language: if True, the language prediction will be added to the predictions for each
          page. Doing so will slightly deteriorate the overall latency.
      **kwargs: keyword args of `DocumentBuilder`
class_docstr_tok: ["Implements","an","object","able","to","localize","and","identify","text","elements","in","a","set","of","documents","Args",":","--","--","det_predictor",":","detection","module","reco_predictor",":","recognition","module","assume_straight_pages",":","if","True",",","speeds","up","the","inference","by","assuming","you","only","pass","straight","pages","without","rotated","textual","elements",".","straighten_pages",":","if","True",",","estimates","the","page","general","orientation","based","on","the","median","line","orientation",".","Then",",","rotates","page","before","passing","it","to","the","deep","learning","modules",".","The","final","predictions","will","be","remapped","accordingly",".","Doing","so","will","improve","performances","for","documents","with","page-uniform","rotations",".","detect_orientation",":","if","True",",","the","estimated","general","page","orientation","will","be","added","to","the","predictions","for","each","page",".","Doing","so","will","slightly","deteriorate","the","overall","latency",".","detect_language",":","if","True",",","the","language","prediction","will","be","added","to","the","predictions","for","each","page",".","Doing","so","will","slightly","deteriorate","the","overall","latency",".","*","*","kwargs",":","keyword","args","of","`","DocumentBuilder","`"]
code: def __init__(
      self,
      det_predictor: DetectionPredictor,
      reco_predictor: RecognitionPredictor,
      assume_straight_pages: bool = True,
      straighten_pages: bool = False,
      preserve_aspect_ratio: bool = True,
      symmetric_pad: bool = True,
      detect_orientation: bool = False,
      detect_language: bool = False,
      **kwargs: Any,
  ) -> None:
      nn.Module.__init__(self)
      self.det_predictor = det_predictor.eval()  # type: ignore[attr-defined]
      self.reco_predictor = reco_predictor.eval()  # type: ignore[attr-defined]
      _OCRPredictor.__init__(
          self,
          assume_straight_pages,
          straighten_pages,
          preserve_aspect_ratio,
          symmetric_pad,
          **kwargs,
      )
      self.detect_orientation = detect_orientation
      self.detect_language = detect_language
  
file_path: doctr/doctr/models/predictor/pytorch.py
imports: from typing import Any, List, Union
  import numpy
  import torch
  from torch import nn
  from doctr.io.elements import Document
  from doctr.models._utils import estimate_orientation, get_language
  from doctr.models.detection.predictor import DetectionPredictor
  from doctr.models.recognition.predictor import RecognitionPredictor
  from doctr.utils.geometry import rotate_image
  from .base import _OCRPredictor
label_desc: Use image node_id 1 to create a new OCRPredictor object from inherited base classes: nn, _OCRPredictor with example: obj = OCRPredictor(det_predictor, reco_predictor, assume_straight_pages, straighten_pages, preserve_aspect_ratio, symmetric_pad, detect_orientation, detect_language)