Aksharize is a lightweight full-stack OCR application designed to recognize Malayalam text from signboards, street signs, and public displays, and provide readable English transliterations.
The project consists of:
-
FastAPI Backend (Python)
Decodes uploaded images, performs OpenCV preprocessing, runs Tesseract OCR, and transliterates Malayalam text into readable English. -
Flutter Frontend (Mobile)
Allows users to capture images using the camera or select images from the gallery, preview them, upload them to the backend, and view OCR and transliteration results.
aksh/
├── backend/
│ ├── app/
│ │ ├── main.py
│ │ ├── routes/
│ │ │ └── ocr.py
│ │ └── services/
│ │ ├── ocr_service.py
│ │ └── transliteration_service.py
│ ├── requirements.txt
│ └── venv/
│
└── aksharize_app/
├── lib/
│ ├── main.dart
│ ├── home_screen.dart
│ └── api_service.dart
└── android/
- Malayalam OCR using Tesseract
- Malayalam to English transliteration
- Kerala place-name dictionary overrides
- Camera image capture
- Gallery image selection
- FastAPI backend
- Flutter mobile frontend
- JSON API responses
- OpenCV image preprocessing
- Cross-platform support
Install Python 3.10 or newer.
Verify installation:
python --versionor
python3 --versionInstall Tesseract and language packs:
brew install tesseract
brew install tesseract-langVerify Malayalam support:
tesseract --list-langsExpected output should include:
eng
mal
sudo apt update
sudo apt install tesseract-ocr
sudo apt install tesseract-ocr-malVerify installation:
tesseract --versionVerify language availability:
tesseract --list-langsExpected output:
eng
mal
Download Tesseract from the UB Mannheim builds:
https://github.com/UB-Mannheim/tesseract/wiki
During installation:
- Select Malayalam language support.
- Install to the default location:
C:\Program Files\Tesseract-OCR
Add Tesseract to your PATH:
C:\Program Files\Tesseract-OCR
Verify installation from Command Prompt:
tesseract --versionVerify Malayalam language support:
tesseract --list-langsExpected output:
eng
mal
Navigate to the backend folder:
cd backendpython3 -m venv venvActivate:
source venv/bin/activateCreate environment:
python -m venv venvActivate (Command Prompt):
venv\Scripts\activate.batActivate (PowerShell):
.\venv\Scripts\Activate.ps1pip install -r requirements.txtuvicorn app.main:app --reload --port 8000Backend URL:
http://127.0.0.1:8000
Swagger Documentation:
http://127.0.0.1:8000/docs
Install Flutter SDK:
https://flutter.dev/docs/get-started/install
Verify installation:
flutter doctorEnsure all required dependencies are installed.
Navigate to the Flutter application:
cd aksharize_appFetch packages:
flutter pub getStart an emulator or connect a physical device.
Run:
flutter runFor Android Emulator:
http://10.0.2.2:8000
This is already configured in the application.
For a physical device, update the API base URL in:
lib/api_service.dart
Example:
const baseUrl = "http://192.168.1.100:8000";Replace with the local IP address of the machine running the FastAPI server.
The OCR pipeline:
- Receive uploaded image.
- Decode image using OpenCV.
- Convert image to grayscale.
- Process using Tesseract OCR.
- Extract Malayalam text.
Current Tesseract configuration:
Language: mal
PSM: 8
OEM: 3
Optimized for:
- Street signs
- Place names
- Shop boards
- Public signage
The transliteration system uses two stages:
Known Kerala place names are mapped to their commonly accepted English spellings.
Examples:
| Malayalam | English |
|---|---|
| തൃശൂർ | Thrissur |
| കൊച്ചി | Kochi |
This ensures outputs match real-world signage and common usage.
If no dictionary match exists, the application falls back to the indic_transliteration library to generate a phonetic English transliteration of the OCR result.
- Support for additional languages
- OCR correction and post-processing improvements
MIT License


