TrOCR
Dedicated Deployment या self-hosted Inference पर text recognition के लिए Microsoft के TrOCR का उपयोग करें
कोड नमूना
3
मॉडल चलाएँ
import base64
import os
import cv2
import numpy as np
import requests
URL = "https://your-deployment.roboflow.cloud"
content = requests.get("https://media.roboflow.com/inference/license_plate_1.jpg").content
image = cv2.imdecode(np.frombuffer(content, np.uint8), cv2.IMREAD_COLOR)
_, buffer = cv2.imencode(".jpg", image)
image_base64 = base64.b64encode(buffer).decode("utf-8")
response = requests.post(
f"{URL}/ocr/trocr",
json={
"api_key": os.environ["ROBOFLOW_API_KEY"],
"image": {"type": "base64", "value": image_base64},
},
)
print(response.json()["result"])कुलInference speed
मॉडल
विलंबता (ms)
अंतिम अपडेट
क्या यह उपयोगी था?