Lightweight OCR server powered by EasyOCR. Works well with Russian and English text — handles mixed-language documents, screenshots, scanned pages, and photos.
On macOS with Apple Silicon, run locally to take advantage of Metal (MPS) GPU acceleration. Docker cannot pass through the Metal GPU, so local execution is significantly faster.
./run.shRequires uv package manager. Dependencies are installed automatically on first run.
docker build -t easyocr-api .
docker run -p 8017:8017 easyocr-apiNote: Docker runs on CPU only. EasyOCR model files (~200 MB) are downloaded on first startup and cached inside the container. For NVIDIA GPU support, use the
--gpus allflag with an NVIDIA runtime installed.
Server starts on http://localhost:8017
curl -X POST -F "file=@image.jpg" http://localhost:8017/ocrcurl -X POST -F "file=@document.png" http://localhost:8017/ocr | jq -r '.text' > result.txt{
"text": "full recognized text",
"blocks": [
{
"text": "text block",
"confidence": 0.95
}
],
"total_blocks": 5
}| Variable | Default | Description |
|---|---|---|
HOST |
0.0.0.0 | Bind address |
PORT |
8017 | Server port |
- Formats: PNG, JPG, JPEG, BMP, TIFF, WEBP
- Languages: Russian + English
- GPU: Metal (MPS) on Apple Silicon, CUDA on NVIDIA, CPU fallback
- Max file size: 50 MB
- Auto resize: large images scaled down to 2048px
- Min size: small images upscaled to 320px
- FastAPI — async HTTP framework
- EasyOCR — text recognition engine
- PyTorch — ML backend (MPS / CUDA / CPU)
Text recognition powered by EasyOCR by JaidedAI (Apache-2.0 license).