dots.ocr -- OCR API

Upload an image and get the extracted text. This Space is optimized for programmatic API access so you can batch-process hundreds of images from an external script.

Calling the API from Python

from gradio_client import Client

client = Client("openpecha/bec-dot.orc-api")
result = client.predict(
    "path/to/image.png",                       # image filepath
    "Extract the text content from this image.", # prompt
    api_name="/predict",
)
print(result)