With the Special Intensive Revision of voter lists being done in Karnataka, and the 2002 voter lists being primarily in Kannada, I needed a way to transliterate the PDF files to English.
So I vibecoded this Python application which can be used either from the GUI or via the commandline. Since some pages may be scanned, and hence the text may not be digitized, or even if it is digitized it may not be in a format that can easily be converted to the desired Unicode format, I decided to process the PDF using Optical Character Recognition (OCR).
The program writes the recognized regional language words into a text file and writes the transliterated text in brackets right next to it.
This is a very basic version of the program. There is much more that can be done to improve it. I considered many other libraries, but there seemed to be too much of a download requirement to use many of them. These are the approximate size requirements info an AI gathered:
- PyMuPDF (PDF parsing): ~40 MB to 90 MB
- PaddleOCR (OCR): ~800 MB – 1.2 GB
- Tesseract (OCR): ~5 MB (+ ~15 MB per language pack)
- PP-Structure / LayoutParser (page layout detection): ~150 MB to 500 MB
- fastText (language detection): ~1 MB (or ~120 MB for full fastText model)
- indic-transliteration / Aksharamukha (transliteration): ~5 MB – 15 MB
- IndicTrans2 (translation): ~2 GB (Distilled) to ~12 GB (Full 1B)
- PyMuPDF or ReportLab (PDF creation): ~3 MB | Lightweight
So for this project I've used PyMuPDF, Tesseract, Pillow, OpenCV, Numpy and Indic-transliteration. If the need arises, I'll add more functionality, but you are welcome to submit PR's too.