> For the complete documentation index, see [llms.txt](https://docs.roboflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roboflow.com/deploy/supported-models/easyocr.md).

# EasyOCR

[EasyOCR](https://github.com/JaidedAI/EasyOCR) is a multilingual optical character recognition model deployable via our [Serverless Hosted API](/deploy/serverless-hosted-api-v2.md). Supported languages include English, Japanese, Kannada, Korean, Latin (covering Spanish, French, Italian, Portuguese, German, Polish, and Dutch), Telugu, and Simplified Chinese.

## Code sample

Run EasyOCR through the HTTP endpoint directly with `curl`, or with the [`inference-sdk`](https://inference.roboflow.com/inference_helpers/inference_sdk/) wrapper.

{% tabs %}
{% tab title="HTTP (curl)" icon="webhook" %}
{% stepper %}
{% step %}

### Get your API Key

Create a Roboflow account, find your key on the [Roboflow API settings page](https://app.roboflow.com/settings/api) and make it available to your shell:

```bash
export ROBOFLOW_API_KEY="your-key-here"
```

{% endstep %}

{% step %}

### Run the model

Call the `/easy_ocr/ocr` endpoint with `curl`:

```bash
curl --location 'https://serverless.roboflow.com/easy_ocr/ocr' \
  --header 'Content-Type: application/json' \
  --data '{
    "api_key": "'"$ROBOFLOW_API_KEY"'",
    "image": {"type": "url", "value": "https://media.roboflow.com/swift.png"},
    "language_codes": ["en"]
  }'
```

{% endstep %}
{% endstepper %}
{% endtab %}

{% tab title="SDK (Python)" icon="python" %}
{% stepper %}
{% step %}

### Get your API Key

Create a Roboflow account, find your key on the [Roboflow API settings page](https://app.roboflow.com/settings/api) and make it available to your shell:

```bash
export ROBOFLOW_API_KEY="your-key-here"
```

{% endstep %}

{% step %}

### Install the dependencies

This package calls the model:

```bash
pip install inference-sdk
```

{% endstep %}

{% step %}

### Run the model

Run EasyOCR on an image:

```python
import os
import cv2
import numpy as np
import requests
from inference_sdk import InferenceHTTPClient

content = requests.get("https://media.roboflow.com/swift.png").content
image = cv2.imdecode(np.frombuffer(content, np.uint8), cv2.IMREAD_COLOR)

client = InferenceHTTPClient(
    api_url="https://serverless.roboflow.com",
    api_key=os.environ["ROBOFLOW_API_KEY"],
)

result = client.ocr_image(
    inference_input=image,
    model="easy_ocr",
    language_codes=["en"],
)

print(result["result"]) # Extracted text
```

The code above prints inference results to the terminal:

```
was thinking earlier today that have gone through, to use the lingo, eras Of listening to each of Swift's Eras. Meta indeed: started listening to Ms. Swift's music after hearing the Midnights album: few weeks after hearing the album for the first time, found myself playing various songs on repeat. listened to the album in order multiple times:
```

{% endstep %}
{% endstepper %}
{% endtab %}
{% endtabs %}

## Inference speed

Latency measured with [Roboflow Inference](https://inference.roboflow.com/) on 1x NVIDIA L4, batch size 1, mean after warmup.

<table data-search="false"><thead><tr><th>Model</th><th>Latency (ms)</th></tr></thead><tbody><tr><td><code>easy_ocr</code></td><td>19.7</td></tr></tbody></table>

Measured on a full document image (text detection plus recognition).

{% hint style="info" %}
Set `api_url` to match your deployment target:

* `https://serverless.roboflow.com` for the Serverless Hosted API.
* `http://localhost:9001` for a local [Inference](https://inference.roboflow.com/) server.
* Your [Dedicated Deployment](/deploy/dedicated-deployments.md) URL for a private endpoint.
  {% endhint %}
