Skip to content

x0152/easy-ocr-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EasyOCR API

Lightweight OCR server powered by EasyOCR. Works well with Russian and English text — handles mixed-language documents, screenshots, scanned pages, and photos.

Quick Start

Local (recommended for Apple Silicon / Metal)

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.sh

Requires uv package manager. Dependencies are installed automatically on first run.

Docker

docker build -t easyocr-api .
docker run -p 8017:8017 easyocr-api

Note: 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 all flag with an NVIDIA runtime installed.

Server starts on http://localhost:8017

Usage

Text recognition

curl -X POST -F "file=@image.jpg" http://localhost:8017/ocr

Save result to file

curl -X POST -F "file=@document.png" http://localhost:8017/ocr | jq -r '.text' > result.txt

Response Format

{
  "text": "full recognized text",
  "blocks": [
    {
      "text": "text block",
      "confidence": 0.95
    }
  ],
  "total_blocks": 5
}

Configuration

Variable Default Description
HOST 0.0.0.0 Bind address
PORT 8017 Server port

Performance

  • Formats: PNG, JPG, JPEG, BMP, TIFF, WEBP
  • Languages: Russian + English
  • GPU: Metal (MPS) on Apple Silicon, CUDA on NVIDIA, CPU fallback

Limits

  • Max file size: 50 MB
  • Auto resize: large images scaled down to 2048px
  • Min size: small images upscaled to 320px

Tech Stack

  • FastAPI — async HTTP framework
  • EasyOCR — text recognition engine
  • PyTorch — ML backend (MPS / CUDA / CPU)

Credits

Text recognition powered by EasyOCR by JaidedAI (Apache-2.0 license).

About

Lightweight OCR API server for Russian and English text recognition, powered by EasyOCR

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors