9f97f3abbe
CI - Node Bindings / Build darwin-arm64 (push) Waiting to run
CI - Node Bindings / Build darwin-x64 (push) Waiting to run
CI - Node Bindings / Test win32-x64-msvc (push) Blocked by required conditions
CI - Node Bindings / Build linux-arm64-gnu (push) Waiting to run
CI - Node Bindings / Build linux-x64-gnu (push) Waiting to run
CI - Node Bindings / Build linux-x64-musl (push) Waiting to run
CI - Node Bindings / Build win32-arm64-msvc (push) Waiting to run
CI - Node Bindings / Build win32-x64-msvc (push) Waiting to run
CI - Node Bindings / Test darwin-arm64 (push) Blocked by required conditions
CI - Node Bindings / Test darwin-x64 (push) Blocked by required conditions
CI - Node Bindings / Test linux-x64-gnu (push) Blocked by required conditions
CI - Node Bindings / Test linux-x64-musl (push) Blocked by required conditions
CI - Node Bindings / Test win32-arm64-msvc (push) Blocked by required conditions
CI - Python Bindings / Build aarch64-pc-windows-msvc (push) Waiting to run
CI - Python Bindings / Build x86_64-pc-windows-msvc (push) Waiting to run
CI - Python Bindings / Build x86_64-apple-darwin (push) Waiting to run
CI - Python Bindings / Build aarch64-apple-darwin (push) Waiting to run
CI - Python Bindings / Build aarch64-unknown-linux-gnu (push) Waiting to run
CI - Python Bindings / Test x86_64-apple-darwin (push) Blocked by required conditions
CI - Python Bindings / Test aarch64-apple-darwin (push) Blocked by required conditions
CI - Python Bindings / Test x86_64-unknown-linux-gnu (push) Blocked by required conditions
CI - Python Bindings / Test x86_64-unknown-linux-musl (push) Blocked by required conditions
CI - Python Bindings / Test aarch64-pc-windows-msvc (push) Blocked by required conditions
CI - Python Bindings / Test x86_64-pc-windows-msvc (push) Blocked by required conditions
CI / build-and-test (macos-26-intel) (push) Waiting to run
CI / build-and-test (macos-latest) (push) Waiting to run
CI / build-and-test (windows-11-arm) (push) Waiting to run
CI / build-and-test (windows-latest) (push) Waiting to run
CI - Python Bindings / sdist (push) Failing after 1s
CI - Python Bindings / Build x86_64-unknown-linux-musl (push) Failing after 1s
CI / fmt (push) Failing after 1s
E2E Output Validation / compare-outputs (push) Failing after 1s
Sync Docs to Developer Hub / sync-docs (push) Failing after 1s
CI - Python Bindings / Build x86_64-unknown-linux-gnu (push) Failing after 1s
CI - WASM Bindings / Build WASM (push) Failing after 0s
CI / clippy (push) Failing after 1s
CI / build-and-test (ubuntu-latest) (push) Failing after 0s
CI - WASM Bindings / Edge runtime PDF parse test (push) Has been skipped
CI - WASM Bindings / Browser PDF parse test (push) Has been skipped
E2E Output Validation / upload-dataset (push) Waiting to run
Deploy Demo to GitHub Pages / deploy (push) Failing after 1s
CI / build-docker-image (push) Failing after 3s
2.3 KiB
2.3 KiB
PaddleOCR Service
This is a simple Flask server that wraps PaddleOCR to conform to the LiteParse OCR API specification (see ../../OCR_API_SPEC.md).
PaddleOCR is especially fast and accurate for Chinese, Japanese, and Korean languages.
Build and Run
# install and run (in one command)
uv run server.py
Usage
The service exposes a single endpoint:
POST /ocr- Perform OCR on an uploaded image
Parameters
file- Image file (multipart/form-data)language- Language code (e.g., 'en', 'zh', 'ja', 'ko')
Example
curl -X POST -F "file=@image.png" -F "language=zh" http://localhost:8829/ocr
Response Format
{
"results": [
{
"text": "recognized text",
"bbox": [x1, y1, x2, y2],
"confidence": 0.95
}
]
}
This conforms to the LiteParse OCR API specification.
Supported Languages
PaddleOCR supports 80+ languages with excellent support for CJK:
en- Englishzh/zh-cn- Chinese (Simplified)zh-tw/zh-hant- Chinese (Traditional)ja- Japaneseko- Koreanfr- Frenchde- Germanes- Spanishpt- Portugueseru- Russianar- Arabichi- Hindi/Devanagari
Full list: https://github.com/PaddlePaddle/PaddleOCR
Performance
PaddleOCR is optimized for speed and accuracy:
- Fast: 2-3x faster than EasyOCR
- Accurate: Especially for Asian languages (Chinese, Japanese, Korean)
- Lightweight: Smaller model sizes
Use with LiteParse
Once the server is running, use it with LiteParse:
# Parse with PaddleOCR
lit parse document.pdf --ocr-server-url http://localhost:8829/ocr
# With specific language
lit parse document.pdf --ocr-server-url http://localhost:8829/ocr --ocr-language zh
Or in code:
import { LiteParse } from 'liteparse';
const parser = new LiteParse({
ocrServerUrl: 'http://localhost:8829/ocr',
ocrLanguage: 'zh',
});
const result = await parser.parse('document.pdf');
Testing
If you make changes to the server, make sure to adapt and run tests:
uv run pytest test_server.py
GPU Support
For GPU acceleration, set use_gpu=True in server.py.
Notes
- First request may be slow as PaddleOCR downloads models
- Models are cached after first use
- Default port is 8829 (different from EasyOCR's 8828)