Image to Text OCR

  • valehprague/image-to-text
  • Modified
  • Users 66
  • Runs 833
  • Created by Author's avatarValeh Farzaliyev

Extract machine readable textual data from image documents

Actor - Image to Text

The actor takes an input image in a specified format (base64 or url) and using asked Optic Character Recognition (OCR) model (PaddleOCR or Tesseract) extracts textual data in required language (See OCR model documentations for available languages). The result is saved into Key-Value store as one of output formats (pdf, txt or bbox)


Input of this actor should be JSON file with following fields:

FieldTypeDescriptionAllowed values
input_typeStringInput image formatbase64 or url
input_imageStringImageAny valid string value
languageStringText languageSee OCR model documentations (e.g en)
ocrStringSpecific OCR modelpaddle or tesseract
output_formatStringDesired output formatbbox/pdf for PaddleOCR or txt/pdf for Tesseract

Sample Input

{ "input_type": "url", "input_image": "", "lang": "eng", "ocr": "tesseract", "output_format": "txt" }


Once the actor finishes, it will output a textual data in specified format.

  • bbox : list of bounding boxes and text inside
  • pdf : Base64 encoded pdf file
  • txt : String text

Sample Output

{ "response": "Sample PDF Document\n\nRobert Maron\nGrzegorz. Grudziriski\n\nFebruary 20, 1999\n\x0c", "error": None }