PP-OCRv5 · CPU Inference
Click or drag image here
Supports PNG, JPG, BMP, WEBP · Max 10MB
POST an image to the OCR endpoint. The server accepts one multipart file field named file and returns merged text plus per-line details.
curl -X POST https://ocr.leejh.cyou/ocr \
-F "file=@your_image.png"Use Python requests library.
import requests
with open("your_image.png", "rb") as f:
r = requests.post(
"https://ocr.leejh.cyou/ocr",
files={"file": f}
)
print(r.json())Browser or Node.js with fetch.
const form = new FormData();
form.append("file", fileInput.files[0]);
const res = await fetch("https://ocr.leejh.cyou/ocr", {
method: "POST",
body: form
});
console.log(await res.json());file. The server currently validates Content-Type with the rule image/*, so common image formats supported by clients and OCR pipelines such as PNG, JPG/JPEG, BMP, WEBP, GIF, and TIFF can be uploaded as long as the request is labeled as an image.
10MB per image. If no text is recognized, the API still returns 200 OK with {"text": "", "lines": []}.
Request Example
POST /ocr
Content-Type: multipart/form-data
file=@your_image.pngResponse Example
{
"text": "示例识别文本",
"lines": [
{
"text": "示例识别文本",
"confidence": 0.9987,
"box": [[12.5, 18.0], [220.1, 18.0], [220.1, 52.3], [12.5, 52.3]]
}
]
}Field Reference
file required image file field (multipart/form-data)
text concatenated OCR text from the whole image
lines array of recognized text lines
lines[].text text content of the line
lines[].confidence confidence score, range 0-1
lines[].box quadrilateral coordinates [[x1,y1],[x2,y2],[x3,y3],[x4,y4]]Error Response Examples
400 Bad Request
{"detail": "Only image files are accepted"}
400 Bad Request
{"detail": "Image too large (max 10MB)"}
500 Internal Server Error
{"detail": ""} Service URL: https://ocr.leejh.cyou · Health check: GET /health