Modular document processing pipeline for Algerian birth certificates. Evaluates EasyOCR, Tesseract, PaddleOCR, and Gemini.
# DocInfoExtract – Algerian Birth Certificate Reader
A modular, open‑source pipeline that extracts structured data from scanned
Algerian birth certificates. It detects the document barcode, locates nine
standard fields, and reads them using a pluggable OCR engine.
## Features
- **Preprocessing** – perspective correction, deskew, normalization
- **Barcode‑based layout** – uses the barcode as a spatial anchor for field positions
- **Nine extracted fields**
- ID Number, Birth Date, Latin & Arabic Names, Birth Place (Baladia / Wilaya),
Gender, Father & Mother Names
- **Four OCR backends**
- **EasyOCR** – free, offline, good for mixed scripts
- **Tesseract** – free, offline, requires language data
- **PaddleOCR** – free, offline, strong Arabic support
- **Google Gemini** – cloud, most accurate, requires an API key
- **Three user interfaces**
- **Command‑line interface** (CLI) with file picker
- **Streamlit web app** with copy‑to‑clipboard and Excel download
- **Excel add‑in** – click a button inside Excel to process an image
- **Easy configuration** – switch OCR engines via the launcher menu; all settings stored in `.env`
---
## Quick start (Windows)
### 1. Prerequisites
- **Python 3.11**
- Download from python.org
- Check **“Add Python to PATH”** during installation
- **Git**
- Download from git-scm.com
- **Tesseract OCR** (only needed if you plan to use the Tesseract engine)
- Install from UB Mannheim’s build
- Select **Arabic language data (`ara`)** during installation
- Verify with `tesseract --version`
### 2. Setup
1. **Clone the repository** (or extract the CD archive)
```bat
git clone
github.com
cd DocInfoExtract
```
2. **Run `setup_venv.bat`** – this creates a Python virtual environment and installs all dependencies.
3. **Run `activate_venv.bat`** – this activates the environment and sets up the default OCR engine.
4. **Start the launcher** by typing `run` and hitting Enter. You’ll see a menu:
```
1. Command Line …