EasyOCR

Use the EasyOCR multilingual OCR model through our Serverless Hosted API

EasyOCR is a multilingual optical character recognition model deployable via our Serverless Hosted API. Supported languages include English, Japanese, Kannada, Korean, Latin (covering Spanish, French, Italian, Portuguese, German, Polish, and Dutch), Telugu, and Simplified Chinese.

Code sample

Call the /easy_ocr/ocr endpoint directly with curl:

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

The same call through the SDK. Install it:

pip install inference-sdk

Run EasyOCR on an image. Pass your Roboflow API Key via the API_KEY env variable.

import os
import urllib.request
from inference_sdk import InferenceHTTPClient

image_url = "https://media.roboflow.com/swift.png"
image_path = "swift.png"
urllib.request.urlretrieve(image_url, image_path)

client = InferenceHTTPClient(
    api_url="https://serverless.roboflow.com",
    api_key=os.getenv("API_KEY"),
)

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

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

The code above prints inference results to the terminal:

Set api_url to match your deployment target:

  • https://serverless.roboflow.com for the Serverless Hosted API.

  • http://localhost:9001 for a local Inference server.

  • Your Dedicated Deployment URL for a private endpoint.

Last updated

Was this helpful?