Views
No views yet
python app.py1from tensorflow.keras.models import load_model
2import cv2
3import numpy as np
4
5# Load the model
6model = load_model('models/devanagari_model.h5')
7
8# Load and preprocess image
9image = cv2.imread('path_to_image.jpg', cv2.IMREAD_GRAYSCALE)
10image = cv2.resize(image, (32, 32))
11image = image.reshape(1, 32, 32, 1) / 255.0
12
13# Make prediction
14prediction = model.predict(image)pip install -r requirements.txt