File size: 879 Bytes
679e114
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import tensorflow as tf
from tensorflow.keras.preprocessing import image
import numpy as np
from huggingface_hub import from_pretrained_keras
model = from_pretrained_keras("okeowo1014/catsanddogs")

# Load the saved model
loaded_model = tf.keras.models.load_model('fingerprint_recognition_model.keras')

# Define the image path for the new image you want to predict
image_path = 'path_to_your_new_image.jpg'

# Load and preprocess the image
img = image.load_img(image_path, target_size=(224, 224), color_mode='grayscale')
img_array = image.img_to_array(img)
img_array = np.expand_dims(img_array, axis=0)
img_array /= 255.  # Normalize the image data

# Make predictions
predictions = loaded_model.predict(img_array)

# Get the predicted class label
predicted_class = np.argmax(predictions[0])

# Print the predicted class label
print(f'Predicted class label: {predicted_class}')