DocTR
Serverless Hosted API を通じて DocTR OCR model を使用します
コードサンプル
3
モデルを実行する
import os
import cv2
import numpy as np
import requests
from inference_sdk import InferenceHTTPClient
# テキストを含むサンプル画像
content = requests.get("https://media.roboflow.com/inference/license_plate_1.jpg").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="doctr")
print(result["result"]) # 抽出されたテキストMr
AUTPMATIC
280SE
34 T6511推論速度
モデル
レイテンシ (ms)
最終更新
役に立ちましたか?