YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
Devanagari Character Recognition
This model recognizes Devanagari characters (numerals, vowels, and consonants) from images. It uses a Convolutional Neural Network (CNN) architecture trained on the NHCD (Nepali Handwritten Character Dataset).
Model Architecture
The model uses a CNN architecture with the following components:
- Multiple Conv2D layers with BatchNormalization
- MaxPooling2D layers for dimensionality reduction
- Dropout layers for regularization
- Dense layers for classification
Usage
You can use this model in two ways:
Using the Gradio Interface:
- Run
python app.py - Open the provided local URL in your browser
- Upload an image of a Devanagari character
- Get the prediction results
- Run
Using the Model Directly:
from tensorflow.keras.models import load_model
import cv2
import numpy as np
# Load the model
model = load_model('models/devanagari_model.h5')
# Load and preprocess image
image = cv2.imread('path_to_image.jpg', cv2.IMREAD_GRAYSCALE)
image = cv2.resize(image, (32, 32))
image = image.reshape(1, 32, 32, 1) / 255.0
# Make prediction
prediction = model.predict(image)
Dataset
The model is trained on the NHCD dataset, which contains:
- Numerals (0-9)
- Vowels
- Consonants
Performance
The model achieves:
- Training accuracy: ~97%
- Validation accuracy: ~95%
- Test accuracy: ~95%
Requirements
Install the required packages:
pip install -r requirements.txt
License
This project is licensed under the MIT License - see the LICENSE file for details.
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support