OCR Quick Start
Integrate an OCR Model.
Install the Client Library
pip install -U mindee~=5.1npm install mindee@^5.5.0php composer.phar require "mindee/mindee:>=3.0"gem install mindee -v '~> 5.2'dotnet add package Mindee --version 4.4Send a File and Poll
from mindee import PathInput
from mindee.v2 import (
Client,
OCRParameters,
OCRResponse,
)
input_path = "/path/to/the/file.ext"
api_key = "MY_API_KEY"
model_id = "MY_MODEL_ID"
# Init a new client
mindee_client = Client(api_key)
# Set Raw OCR parameters
model_params = OCRParameters(
# ID of the model, required.
model_id=model_id,
)
# Load a file from disk
input_source = PathInput(input_path)
# Send for processing using polling
response = mindee_client.enqueue_and_get_result(
OCRResponse,
input_source,
model_params,
)
# Print a brief summary of the parsed data
print(response.inference)
# Access the OCR result
pages: list = response.inference.result.pagesLast updated
Was this helpful?

