GLM-OCR
Serverless Hosted API를 통해 이미지 OCR에 GLM-OCR을 사용합니다.
코드 샘플
2
모델을 실행하세요
curl --location 'https://serverless.roboflow.com/infer/lmm' \
--header 'Content-Type: application/json' \
--data '{
"api_key": "'"$ROBOFLOW_API_KEY"'",
"image": {"type": "url", "value": "https://media.roboflow.com/inference/license_plate_1.jpg"},
"model_id": "glm-ocr",
"prompt": "OCR",
"max_new_tokens": 128
}'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.infer_lmm(
image,
model_id="glm-ocr",
prompt="OCR",
max_new_tokens=128,
)
print(result["response"] )280 SE
AUTOMATIC
34 T 6511
추론 속도
별칭
지연 시간, 128 토큰(ms)
Tokens/sec
마지막 업데이트
도움이 되었나요?