{"id":2942,"library":"easyocr","title":"EasyOCR","description":"EasyOCR is an end-to-end multi-lingual optical character recognition (OCR) solution designed for ease of use. It supports over 80 languages and provides pre-trained models for common use cases. The current version is 1.7.2, with minor releases focusing on compatibility and bug fixes, and major updates introducing new features like detector networks or Apple Silicon support.","status":"active","version":"1.7.2","language":"en","source_language":"en","source_url":"https://github.com/jaidedai/easyocr","tags":["OCR","image processing","deep learning","computer vision","text extraction"],"install":[{"cmd":"pip install easyocr","lang":"bash","label":"Basic installation (CPU-only)"},{"cmd":"pip install easyocr opencv-python-headless","lang":"bash","label":"Recommended installation (for server environments)"},{"cmd":"pip install easyocr torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118","lang":"bash","label":"Installation with GPU support (Example for CUDA 11.8)"}],"dependencies":[{"reason":"Core deep learning framework. While easyocr installs a CPU-compatible version by default, GPU acceleration requires a specific CUDA-enabled PyTorch installation which must be installed separately and correctly.","package":"torch","optional":false},{"reason":"Image processing backend. `opencv-python` can also be used, but `opencv-python-headless` is preferred for server environments without a GUI.","package":"opencv-python-headless","optional":false},{"reason":"Image manipulation library, used for handling image inputs.","package":"Pillow","optional":false}],"imports":[{"symbol":"Reader","correct":"import easyocr\nreader = easyocr.Reader(['en'])"}],"quickstart":{"code":"import easyocr\nimport os\nfrom PIL import Image, ImageDraw\n\n# Create a dummy image for demonstration purposes\ndummy_image_path = 'easyocr_demo_image.png'\nimg = Image.new('RGB', (400, 100), color = (255, 255, 255))\nd = ImageDraw.Draw(img)\nd.text((10, 10), \"Hello EasyOCR!\\nThis is a test.\", fill=(0,0,0))\nimg.save(dummy_image_path)\n\n# Initialize Reader with desired languages.\n# Models are downloaded on first run for each language.\n# Set gpu=True if you have CUDA-enabled PyTorch installed, otherwise leave as False.\nreader = easyocr.Reader(['en', 'fr'], gpu=False)\n\n# Perform OCR on the image file\n# result will be a list of tuples: (bounding_box, text, confidence)\nresult = reader.readtext(dummy_image_path)\n\nprint(f\"OCR Results for '{dummy_image_path}':\")\nfor (bbox, text, conf) in result:\n    print(f\"  Text: '{text}', Confidence: {conf:.2f}\")\n\n# Clean up the dummy image\nos.remove(dummy_image_path)","lang":"python","description":"This quickstart code creates a simple dummy image with text, then initializes an EasyOCR Reader for English and French. The first time you run this for a new language, it will download the necessary language models. It then performs OCR on the image and prints the detected text along with its confidence score. For GPU acceleration, ensure you have correctly installed PyTorch with CUDA support and set `gpu=True`."},"warnings":[{"fix":"After installing easyocr, install PyTorch with CUDA from the official PyTorch website based on your CUDA version (e.g., `pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118`). Then, initialize `easyocr.Reader(..., gpu=True)`.","message":"EasyOCR runs on PyTorch. For GPU acceleration, you MUST install a CUDA-enabled version of PyTorch separately. `pip install easyocr` will only install a CPU-compatible PyTorch if it's not already present.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure an active internet connection on first use. For production, consider pre-downloading models or packaging them with your application (refer to EasyOCR documentation for model locations).","message":"The first initialization of `easyocr.Reader` for a new language will download large model files (several hundreds of MBs). This requires an internet connection and can cause a delay.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Consult the official EasyOCR GitHub repository for the list of supported languages. If your language is not supported or performs poorly, consider training a custom model.","message":"Not all languages are supported by pre-trained models. Specifying an unsupported language or a non-existent model name will lead to an error or unexpected behavior.","severity":"gotcha","affected_versions":"All versions"},{"fix":"To use DBNET, initialize `reader = easyocr.Reader(['en'], detect_network='dbnet18')`. If you need to ensure the CRAFT detector (the default prior to v1.6.0), you can explicitly set `detect_network='craft'`.","message":"The `detect_network` argument was introduced in v1.6.0 to allow specifying alternative text detectors (e.g., 'dbnet18'). Prior to this, only the CRAFT detector was available. If you upgrade from an older version or need to ensure a specific detector, you might need to explicitly set this argument.","severity":"gotcha","affected_versions":"Prior to 1.6.0"},{"fix":"For large images, consider pre-processing to resize or split them. For memory-constrained environments, run on CPU (`gpu=False`) and process images in batches or sequentially. Monitor resource usage and adjust configurations accordingly.","message":"EasyOCR can be memory-intensive, especially when processing high-resolution images or multiple languages simultaneously, consuming significant RAM or VRAM.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}