# OCR

## Try it in the Widget Center

Click this [url](https://app.myshell.ai/robot-workshop/widget/1781991441343897600) to try this widget and copy the Pro Config template.

## Usage

\<TODO: enter description here, and remove useless inputs>

**Input Parameters**

<table><thead><tr><th>Name</th><th>Type</th><th>Description</th><th>Default</th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>url</td><td><code>string</code></td><td>URL of the jpg, this image contains text information that you want to use OCR to recognize</td><td></td><td>true</td></tr><tr><td>language</td><td><code>string</code></td><td>Main language of the content in the input image, specify the correct language will improve the ocr performance. Choose from ['EN', 'ZH', 'KR', 'JP', 'GE', 'FR']</td><td></td><td>false</td></tr><tr><td>return_image</td><td><code>boolean</code></td><td>Besides the returned list of text, return the annotated image as well</td><td>False</td><td>false</td></tr></tbody></table>

**Output Parameters**

| Name   | Type     | Description                                        | File Type |
| ------ | -------- | -------------------------------------------------- | --------- |
| url    | `string` | The annotated ocr image url                        | `image`   |
| result | `array`  | The result of ocr. A list, each element is a word. |           |

**Output Example**

{% tabs %}
{% tab title="success" %}
{% code fullWidth="false" %}

```json
{  // input https://replicate.delivery/pbxt/KZczgVh1gAp7xfPP79GdZoGdKEoekcLPiqSqE6bEgM5pThGD/example_1.jpg
  "result": [
    "R\u0026D QUALITY IMPROVEMENT",
    "SUGGESTION/SOLUTION FORM",
    "Name/Phone Ext.:M.Hamann.P.Harper.P.Martinez",
    "Date:",
    "9/3/92",
    "Supervisor/Manager:L.S.Wigand",
    "R\u0026D Group_Licensee",
    "Suggestion:",
    "Discontinue coal retention analyses on licensee submitted",
    "product samples.",
    "Note Coal Retention testing is not",
    "performed by most licensees. Other B\u0026w physical",
    "measurements as ends stability and inspection for soft",
    "spots in cigarettes are thought to be sufficient measures",
    "to assure cigarette physical integrity.",
    "The proposed",
    "action will increase laboratory productivity.)",
    "Suggested Solutions: Delete coal retention from the list of standard",
    "analyses performed on licensee submitted",
    "product samples. Special requests for coal",
    "retention testing could still be submitted on",
    "an exception basis.",
    "Have you contacted your Manager/Supervisor?",
    "ves",
    "No",
    "Manager Comments: Nanager, please contact suggester and forward",
    "comments to the Quality Council.",
    "dmdyb",
    "597005708"
  ],
  "url": "https://image.myshell.ai/image/chat/embed_obj/40295/20240423/8fd1b3ede8be4c91ace2f67ecb783ccf.jpg" // if return_image is check
}
```

{% endcode %}
{% endtab %}

{% tab title="fail" %}
{% code fullWidth="false" %}

```json
Http error
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Detailed Guidelines
