class_docstr: A wrapper for `Tesseract <https://github.com/tesseract-ocr/tesseract>`_ Text
  Detection APIs based on `PyTesseract <https://github.com/tesseract-ocr/tesseract>`_.
class_docstr_tok: ["A","wrapper","for","`","Tesseract","<","https",":","\/\/github.com\/tesseract-ocr\/tesseract",">","`","_","Text","Detection","APIs","based","on","`","PyTesseract","<","https",":","\/\/github.com\/tesseract-ocr\/tesseract",">","`","_","."]
docstr: Send the input image for OCR.
  
  Args:
      image (:obj:`np.ndarray` or :obj:`str`):
          The input image array or the name of the image file
      return_response (:obj:`bool`, optional):
          Whether directly return all output (string and boxes
          info) from Tesseract.
          Defaults to `False`.
      return_only_text (:obj:`bool`, optional):
          Whether return only the texts in the OCR results.
          Defaults to `False`.
      agg_output_level (:obj:`~TesseractFeatureType`, optional):
          When set, aggregate the GCV output with respect to the
          specified aggregation level. Defaults to `None`.
docstr_tok: ["Send","the","input","image","for","OCR",".","Args",":","image","(",":","obj",":","`","np.ndarray","`","or",":","obj",":","`","str","`",")",":","The","input","image","array","or","the","name","of","the","image","file","return_response","(",":","obj",":","`","bool","`",",","optional",")",":","Whether","directly","return","all","output","(","string","and","boxes","info",")","from","Tesseract",".","Defaults","to","`","False","`",".","return_only_text","(",":","obj",":","`","bool","`",",","optional",")",":","Whether","return","only","the","texts","in","the","OCR","results",".","Defaults","to","`","False","`",".","agg_output_level","(",":","obj",":","`","~TesseractFeatureType","`",",","optional",")",":","When","set",",","aggregate","the","GCV","output","with","respect","to","the","specified","aggregation","level",".","Defaults","to","`","None","`","."]
code: def detect(
      self,
      image,
      return_response=False,
      return_only_text=True,
      agg_output_level=None,
  ):
      """Send the input image for OCR.
  
      Args:
          image (:obj:`np.ndarray` or :obj:`str`):
              The input image array or the name of the image file
          return_response (:obj:`bool`, optional):
              Whether directly return all output (string and boxes
              info) from Tesseract.
              Defaults to `False`.
          return_only_text (:obj:`bool`, optional):
              Whether return only the texts in the OCR results.
              Defaults to `False`.
          agg_output_level (:obj:`~TesseractFeatureType`, optional):
              When set, aggregate the GCV output with respect to the
              specified aggregation level. Defaults to `None`.
      """
  
      res = self._detect(image)
  
      if return_response:
          return res
  
      if return_only_text:
          return res["text"]
  
      if agg_output_level is not None:
          return self.gather_data(res, agg_output_level)
  
      return res["text"]
  
file_path: layout-parser/src/layoutparser/ocr/tesseract_agent.py
imports: import io
  import csv
  import pickle
  import pandas
  from .base import BaseOCRAgent, BaseOCRElementType
  from ..io import load_dataframe
  from ..file_utils import is_pytesseract_available
label_desc: Use image node_id 4 for calling the TesseractAgent obj's underlying member method code with example usage: obj.detect(image, return_response, return_only_text, agg_output_level) and returns: res, res, res, self