Skip to content

Repository files navigation

IndicPhotoOCR Logo

A Comprehensive Toolkit for Scene Text Recognition in Indian Languages

Paper Hugging Face Colab Documentation Project Page

Open Source Stars Forks License


Welcome to IndicPhotoOCR! ⚡ We've built an scene text recognition toolkit designed for detecting, identifying, and recognizing text across 11 Indian languages (plus English).

Supported Languages: Assamese, Bengali, Gujarati, Hindi, Kannada, Malayalam, Marathi, Odia, Punjabi, Tamil, Telugu, and English. (with Urdu and Meitei in the pipeline!)



📅 Updates Timeline

[August 2026]: Oral presentation ICDAR 2026 in Vienna, Austria.
[April 2026]: Accepted at International Journal on Document Analysis and Recognition (IJDAR) 20026.
[August 2025]: Project page created.
[April 2025]: Documentation page created using Sphnix.
[March 2025]: Support for Huggingface Demo extened to 12 languages.
[Feburary 2025]: Added option to choose between tri-lingual and 12 class script identifiction models.
[Feburary 2025]: Added recoginition models for Malayalam and Kannada.
[January 2025]: Added ViT based script identification models.
[January 2025]: Demo available in huggingface space.
Currently demo supports scene images containing bi-lingual Hindi and English text.
[December 2024]: Detection Module: TextBPN++ added.
[November 2024]: Code available at Google Colab.
[November 2024]: Added support for 10 languages in the recognition module.
[September 2024]: Repository created.


📦 Quick Installation

We recommend creating a virtual environment before installing:

conda create -n indicphotoocr python=3.10 -y
conda activate indicphotoocr

git clone https://github.com/Bhashini-IITJ/IndicPhotoOCR.git
cd IndicPhotoOCR
pip install -e .

💡 How to Use

Using IndicPhotoOCR is incredibly simple. You can execute the entire End-to-End Scene Text Recognition pipeline (Detection ➡️ Identification ➡️ Recognition) with just three lines of Python!

💥 End-to-End Pipeline (Fastest Method)

from IndicPhotoOCR.ocr import OCR

# Initialize the OCR Engine
ocr_system = OCR(verbose=False, identifier_lang="auto", device="cuda:0")

# Boom! Run the whole pipeline natively
results = ocr_system.ocr("test_images/image_141.jpg")

# The output is a structured list of lines (paragraphs), where each line is a list of words sequentially ordered left-to-right!
# Example Output:
# [
#    ["राजीव", "चौक", "मेट्रो", "स्टेशन"],   <-- Line 1
#    ["Rajiv", "Chowk", "Metro", "Station"]  <-- Line 2
# ]
fast_results = ocr_system.ocr("test_images/image_141.jpg", batch_size=32)

Inference and Evaluation on BSTD

# run the following script while providing path to directory of images
python end-to-end-Inference.py --path </path/to/images>
# by default it will create indicPhotoOCR_predictions.json

# use the following script to reproduce the results provided in the IJDAR version
python end-to-end-Evaluation.py -g <path/to/bstd/json> -p indicPhotoOCR.json
# bstd json is in the first section named as BSTD_17.57.json in repository

🎯 Modular Execution (Advanced)

If you do not want to run the entire pipeline at once, you can hook into individual modules manually:

1. Text Detection Module Extract coordinates of all bounding boxes containing text in an image.
from IndicPhotoOCR.ocr import OCR

ocr_system = OCR(verbose=True, device="cuda:0")

# Get raw bounding box detections
detections = ocr_system.detect("test_images/image_141.jpg")

# Optional: Visualize and save the detected bounding boxes
ocr_system.visualize_detection("test_images/image_141.jpg", detections)
# Saves an image with boxes drawn over it
2. Script Identification Module Take a single, cropped image of a word and predict what language it is written in.
from IndicPhotoOCR.ocr import OCR

ocr_system = OCR(verbose=True, identifier_lang="auto", device="cuda:0")

# Identify script of a cropped word
lang = ocr_system.identify("test_images/cropped_word.jpg")
print(lang)
# Output: 'hindi'
3. Text Recognition Module Extract the literal text string from a cropped word image (and optionally get its confidence score).
from IndicPhotoOCR.ocr import OCR

ocr_system = OCR(verbose=True, device="cuda:0")

# Recognize text (old behavior, returns string)
text = ocr_system.recognise("test_images/cropped_word.jpg", "hindi")

# Recognize text WITH Confidence Score (new behavior)
text, conf_score = ocr_system.recognise("test_images/cropped_word.jpg", "hindi", return_confidence=True)
print(f"Recognized: {text} | Certainty: {conf_score * 100:.2f}%")

📚 Related Datasets & Citations

  • Bharat Scene Text Dataset - BSTD

🎉 Our paper has been officially accepted in IJDAR (International Journal on Document Analysis and Recognition)!

If you use IndicPhotoOCR in your research, please cite us:

@article{De2026,
  author    = {De, Anik and Penamakuri, Abhirama Subramanyam and Yadav, Rajeev and Rathore, Aditya and Shah, Harshiv and Sharma, Devesh and Agarwal, Sagar and Kumar, Pravin and Mishra, Anand},
  title     = {Bharat scene text: a novel comprehensive dataset and benchmark for indian language scene text understanding},
  journal   = {International Journal on Document Analysis and Recognition (IJDAR)},
  year      = {2026},
  issn      = {1433-2825},
  doi       = {10.1007/s10032-026-00583-9},
  url       = {https://doi.org/10.1007/s10032-026-00583-9}
}

🤝 Project Contributors

Anik De - Tech Lead & Main Contributor
Abhirama Aditya Rathore Harshiv Shah
Sagar Agarwal Rajeev Yadav Pravin Kumar
Anand Mishra - Project Investigator

🙏 Acknowledgements

📬 Contact us

For any queries, please contact us at: