Views
No views yet
VGG16 (frozen weights)
├── BatchNormalization
├── Flatten
├── Dense(1024, relu) + L2 regularization
├── BatchNormalization + Dropout(0.5)
├── Dense(512, relu) + L2 regularization
├── BatchNormalization + Dropout(0.4)
└── Dense(443, softmax)1from huggingface_hub import hf_hub_download
2import tensorflow as tf
3import pandas as pd
4
5# Download model and class names
6model_path = hf_hub_download(repo_id="srikarthikv/kannada-ocr-443-classes", filename="kannada_model_full.h5")
7class_names_path = hf_hub_download(repo_id="srikarthikv/kannada-ocr-443-classes", filename="class_names.csv")
8
9# Load model
10model = tf.keras.models.load_model(model_path)
11
12# Load class names
13class_df = pd.read_csv(class_names_path)
14class_names = class_df['class_name'].tolist()1import cv2
2import numpy as np
3
4def preprocess_image(image_path):
5 # Read and resize image
6 img = cv2.imread(image_path)
7 img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
8 img = cv2.resize(img, (128, 128))
9
10 # Normalize and add batch dimension
11 img = img.astype(np.float32) / 255.0
12 img = np.expand_dims(img, axis=0)
13
14 return img
15
16# Make prediction
17image = preprocess_image("path/to/kannada_character.jpg")
18predictions = model.predict(image)
19
20# Get top prediction
21top_class_idx = np.argmax(predictions[0])
22confidence = predictions[0][top_class_idx]
23predicted_character = class_names[top_class_idx]
24
25print(f"Predicted Character: {predicted_character}")
26print(f"Confidence: {confidence:.4f}")1pip install streamlit opencv-python
2streamlit run test_model_ui.pykannada_model_full.h5 - Complete trained model (168 MB)class_names.csv - Character class mappingstest_model_ui.py - Interactive Streamlit UI for testing| Metric | Value |
|---|---|
| Model Size | 168 MB |
| Parameters | 17.3M total (2.6M trainable) |
| Training Time | 3h 9m |
| GPU Memory | ~12GB (dual RTX 4090) |
| Inference Time | ~10ms per image |
1@misc{kannada-ocr-443,
2 title={Kannada OCR Model with 443 Character Classes},
3 author={Your Name},
4 year={2025},
5 url={https://huggingface.co/srikarthikv/kannada-ocr-443-classes}
6}