Text Recognition Api


Text Recognition api allow you to extract text from image , video or any visual documents. Our Api are trained to detect more than 100 different languages and many scripts.

Text Recognition

Supported languages

"afr", "amh", "ara", "asm", "aze", "bel", "ben", "bod", "bos", "bre", "bul", "cat", "ceb", "ces", "chi_sim", "chi_tra", "chr", "cos", "cym", "dan", "deu", "div", "dzo", "ell", "eng", "enm", "epo", "equ", "est", "eus", "fao", "fas", "fil", "fin", "fra", "frk", "frm", "fry", "gla", "gle", "glg", "grc", "guj", "hat", "heb", "hin", "hrv", "hun", "hye", "iku", "ind", "isl", "ita", "ita_old", "jav", "jpn", "jpn_vert", "kan", "kat", "kat_old", "kaz", "khm", "kir", "kmr", "kor", "lao", "lat", "lav", "lit", "ltz", "mal", "mar", "mkd", "mlt", "mni", "mon", "mri", "msa", "mya", "nep", "nld", "nor", "oci", "ori", "osd", "pan", "pol", "por", "pus", "que", "ron", "rus", "san", "sat", "sin", "slk", "slv", "snd", "spa", "spa_old", "sqi", "srp", "srp_latn", "sun", "swa", "swe", "syr", "tam", "tat", "tel", "tgk", "tha", "tir", "ton", "tur", "uig", "ukr", "urd", "uzb", "uzb_cyrl", "vie", "yid", "yor"

These are 3 digits language code. You can lookup for Language Code

Endpoint

POST - /ml/text-recognition

Parameters

  • file

    • required
    • Type: Image File
    • Size: Max File Size Allowed 20MB
    • Details: Image file is required with text to extract text from it.
  • lang

    • optional
    • Type: lang code from above suppored languages
    • Default: eng
  • type

    • optional
    • Type: text,data,osd,box
    • Default: text

Example

Sample Image used

detection-demo image

Request

curl --form "file=@hind-text-image.jpg&lang=hin $BASE_ROUTE/ml/text-recognition

Response with different type

{
  "data": [
    "Oyyi is free to Use"
  ],
  "status": "done"
}
{
  "data": [
    {
      "block_num": 1,
      "conf": 76.084854,
      "height": 81,
      "left": 86,
      "level": 5,
      "line_num": 1,
      "page_num": 1,
      "par_num": 1,
      "text": "Oyyi",
      "top": 117,
      "width": 191,
      "word_num": 1
    },
    {
      "block_num": 1,
      "conf": 95.796791,
      "height": 63,
      "left": 306,
      "level": 5,
      "line_num": 1,
      "page_num": 1,
      "par_num": 1,
      "text": "is",
      "top": 117,
      "width": 63,
      "word_num": 2
    },
    {
      "block_num": 1,
      "conf": 95.796791,
      "height": 63,
      "left": 400,
      "level": 5,
      "line_num": 1,
      "page_num": 1,
      "par_num": 1,
      "text": "free",
      "top": 117,
      "width": 165,
      "word_num": 3
    },
    {
      "block_num": 1,
      "conf": 96.92823,
      "height": 55,
      "left": 594,
      "level": 5,
      "line_num": 1,
      "page_num": 1,
      "par_num": 1,
      "text": "to",
      "top": 125,
      "width": 79,
      "word_num": 4
    },
    {
      "block_num": 1,
      "conf": 96.194183,
      "height": 62,
      "left": 702,
      "level": 5,
      "line_num": 1,
      "page_num": 1,
      "par_num": 1,
      "text": "Use",
      "top": 118,
      "width": 154,
      "word_num": 5
    }
  ],
  "status": "done"
}
{
  "data": {
    "orientation": 270,
    "orientation_conf": 14,
    "page_num": 0,
    "rotate": 90,
    "script": "Latin",
    "script_conf": 2
  },
  "status": "done"
}
{
  "data": [
    "O 86 123 148 186 0",
    "y 134 105 180 186 0",
    "y 152 105 253 166 0",
    "i 255 124 277 186 0",
    "i 306 124 328 186 0",
    "s 334 123 369 167 0",
    "f 400 124 464 186 0",
    "r 449 123 487 186 0",
    "e 469 123 513 167 0",
    "e 520 123 565 167 0",
    "t 594 123 622 178 0",
    "o 628 123 673 167 0",
    "U 702 123 764 185 0",
    "s 769 123 804 167 0",
    "e 812 123 856 167 0"
  ],
  "status": "done"
}
Contributors: coder9118