<jupyter_start><jupyter_text>Testing using images<jupyter_code>from tensorflow.keras.applications.mobilenet import preprocess_input
from tensorflow.keras.preprocessing.image import img_to_array
from tensorflow.keras.models import load_model
from matplotlib import pyplot as plt
import numpy as np
import os
import cv2


model =load_model(r"C:\Users\mdowrla\.ipynb_checkpoints\Cat_Dog_Dataset\Dataset\model.h5")
import warnings
warnings.filterwarnings('ignore')
import matplotlib.image as mpimg


path = r"C:\Users\mdowrla\.ipynb_checkpoints\Cat_Dog_Dataset\Test_Dog.jpg"
plt.imshow(mpimg.imread(path))
image = load_img(path, target_size=(224,224))
image= img_to_array(image)
image=preprocess_input(image)
image=np.expand_dims(image,axis=0)
result = model.predict(image)
print(result)


if result[0][0] > result[0][1]:
    print("Cat")
else:
    print("Dog")<jupyter_output>Dog
{'fraction_non_alphanumeric': 0.11187214611872145, 'fraction_numerical': 0.014840182648401826, 'mean_word_length': 7.514563106796117, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '142441', 'license': 'Apache-2.0', 'n_tokens_mistral': 331, 'n_tokens_neox': 319, 'n_words': 56, 'path': 'Documents/PreTrainedAPI/Cat vs Dog-checkpoint.ipynb', 'repo_name': 'praful2192/Vertex-AI', 'size': '876'}