JaidedAI/EasyOCR
Ready-to-use OCR with 80+ supported languages and all popular writing scripts including Latin, Chinese, Arabic, Devanagari, Cyrillic and etc.
EasyOCR — What It Does and How to Use It
EasyOCR is a ready-to-use optical character recognition (OCR) library — meaning it extracts text from images. You give it a picture containing text, and it returns the text it finds, along with where each piece of text is located and how confident it is.
Key Capabilities
- Supports 80+ languages, covering popular writing scripts: Latin, Chinese, Arabic, Devanagari, Cyrillic, and more.
- Works with multiple input types: a file path, an OpenCV image object (numpy array), raw image bytes, or a URL to a raw image.
- Outputs structured results: for each detected text, you get a bounding box (the four corner coordinates), the detected text itself, and a confidence score between 0 and 1.
- Runs on GPU or CPU: if you don't have a GPU (or it has low memory), you can force CPU-only mode with
gpu=False. - Can be used from Python or the command line.
How It Works (Briefly)
Under the hood, EasyOCR uses deep learning models built on PyTorch. It has two main stages:
- Detection — finds where text is in the image (using the CRAFT algorithm).
- Recognition — reads the characters in those detected regions (using a CRNN model with ResNet/VGG feature extraction, LSTM sequence labeling, and CTC decoding).
You don't need to understand these internals to use it — they're handled automatically.
Installation
Install the latest stable version with pip:
pip install easyocr
Or install the latest development version directly from GitHub:
pip install git+https://github.com/JaidedAI/EasyOCR.git
Windows note: install PyTorch and torchvision first from the official PyTorch website, selecting the right CUDA version (or CUDA = None for CPU-only).
Optional detector: if you want to use the DBNet detector (detect_network='dbnet18'), install with pip install "easyocr[dbnet]" — this compiles C++/CUDA operations on first use and needs the Ninja build tool.
Basic Usage (Python)
import easyocr
# Load the model into memory (only needs to run once)
reader = easyocr.Reader(['ch_sim', 'en'])
# Read text from an image
result = reader.readtext('chinese.jpg')
The result is a list, where each item contains:
- A bounding box (four corner coordinates)
- The detected text
- A confidence level
Example output:
[([[189, 75], [469, 75], [469, 165], [189, 165]], '愚园路', 0.3754989504814148),
([[86, 80], [134, 80], [134, 128], [86, 128]], '西', 0.40452659130096436),
...]
Simpler output
Set detail=0 to get just the text, without bounding boxes or confidence:
reader.readtext('chinese.jpg', detail=0)
Result:
['愚园路', '西', '东', '315', '309', 'Yuyuan Rd.', 'W', 'E']
Language notes
- Pass a list of language codes, e.g.,
['ch_sim', 'en']. - You can pass several languages at once, but not all combinations work. English is compatible with every language, and languages sharing common characters are usually compatible.
- Model weights for the chosen languages are downloaded automatically (or you can download them manually from the model hub and place them in
~/.EasyOCR/model).
CPU-only mode
reader = easyocr.Reader(['ch_sim', 'en'], gpu=False)
Command-Line Usage
easyocr -l ch_sim en -f chinese.jpg --detail=1 --gpu=True
Training Your Own Models
- For the recognition model, see the custom model documentation.
- For the detection model (CRAFT), see the trainer README.
Roadmap & Future Plans
- Handwritten text support is planned.
- The code is being restructured to allow swapping detection and recognition algorithms, so you could plug in any state-of-the-art model easily. The goal is to make cutting-edge OCR research quickly accessible to everyone.
Try It Without Installing
There's a web demo on the EasyOCR website and a Hugging Face Spaces demo using Gradio.
Contributing & Support
- Coders: send pull requests for small fixes; open an issue first for bigger changes. Look for issues tagged
PR WELCOME. - Users: share how EasyOCR helps you, and report failure cases in the Issues section.
- Tech leaders: spread the word.
- New language requests: require a PR with two files — a character list and a word list for that language. Popular languages or those sharing characters with existing ones get priority.
- Enterprise support: Jaided AI offers custom OCR/AI systems (implementation, training/finetuning, deployment).
Important Caveats
- Loading the model takes time, but only needs to happen once per session.
- GitHub issues older than 6 months are automatically closed due to limited resources.
- The project is based on several research papers and open-source repositories (CRAFT, CRNN, deep-text-recognition-benchmark, etc.), all acknowledged in the README.
Related
- Project
- Project
- Project
- Project