Use the widget below to experiment with DocTR. You can detect COCO classes such as people, vehicles, animals, household items.
DocTR is an Optical Character Recognition (OCR) model. You can use DocTR to read the text in an image.
DocTR
is licensed under a
Apache-2.0
license.
You can use Roboflow Inference to deploy a
DocTR
API on your hardware. You can deploy the model on CPU (i.e. Raspberry Pi, AI PCs) and GPU devices (i.e. NVIDIA Jetson, NVIDIA T4).
Below are instructions on how to deploy your own model API.
DocTR is an Optical Character Recognition (OCR) model.
You can use DocTR to read the text in an image.
To use DocTR with Inference, you will need a Roboflow API key. If you don't already have a Roboflow account, sign up for a free Roboflow account.
Then, retrieve your API key from the Roboflow dashboard. Learn how to retrieve your API key.
Run the following command to set your API key in your coding environment:
export ROBOFLOW_API_KEY=<your api key>
Use the following code to run DocTR:
import os
from inference_sdk import InferenceHTTPClient
CLIENT = InferenceHTTPClient(
api_url="https://infer.roboflow.com",
api_key=os.environ["ROBOFLOW_API_KEY"]
)
result = CLIENT.ocr_image(inference_input="./container.jpg") # single image request
print(result)