Tamil-Heritage-Ai

🏛️ Tamil Heritage AI

A research-grade Python application designed to digitize, segment, and recognize ancient Tamil script from degraded stone inscriptions and palm-leaf manuscripts. This project leverages advanced image preprocessing techniques and a custom-trained Convolutional Neural Network (CNN) to achieve high-accuracy character recognition, complete with explainable AI (Grad-CAM) visualization.

🌟 Key Features

🚀 Getting Started

Prerequisites

Installation

  1. Clone the repository:
    git clone https://github.com/Ricthi/Ai-heritage-.git
    cd Ai-heritage-
    
  2. Install dependencies:
    pip install -r requirements.txt
    

    (Ensure you have streamlit, torch, torchvision, opencv-python, numpy, pillow, pandas, and streamlit-drawable-canvas installed).

Running the Application

Launch the Streamlit dashboard:

cd tamil_heritage_ai/Model-Creation
streamlit run main_app.py

The app will open automatically in your browser at http://localhost:8501.

🧠 Training Your Own Model

If you have new labeled datasets of ancient characters, you can easily retrain the CNN.

  1. Organize Labels: Place your class folders inside tamil_heritage_ai/Labels/.
  2. Prepare Dataset: Run the dataset prep script to automatically split your images into train and val sets:
    python prepare_dataset.py
    
  3. Train the Model: Run the training script to generate a new model_stone.pth:
    python train_stone_cnn.py
    
  4. Use It: The Streamlit app will automatically detect model_stone.pth. Select it from the sidebar dropdown!

📁 Repository Structure


Built to preserve and digitize the rich epigraphical history of the Tamil language.