diff --git a/Network/TesterRandom.py b/Network/TesterRandom.py index 3a69073..73ceb50 100644 --- a/Network/TesterRandom.py +++ b/Network/TesterRandom.py @@ -1,14 +1,13 @@ +import os +import numpy as np import tensorflow as tf from tensorflow import keras -from tensorflow.keras.preprocessing import image -import numpy as np -import os # Load the trained model model = keras.models.load_model('trained_model.h5') # Load the class names -class_names = ['Empty', 'Food','People'] +class_names = ['Table', 'Done','Order'] # Path to the folder containing test images test_images_folder = 'Testing/' @@ -23,11 +22,11 @@ for folder_name in os.listdir(test_images_folder): # True class based on folder name if folder_name == 'Empty': - true_class = 'Empty' + true_class = 'Table' elif folder_name == 'Food': - true_class = 'Food' + true_class = 'Done' elif folder_name == 'People': - true_class = 'People' + true_class = 'Order' true_class = folder_name # Iterate over the files in the subfolder @@ -36,8 +35,8 @@ for folder_name in os.listdir(test_images_folder): i+=1 # Load and preprocess the test image image_path = os.path.join(folder_path, filename) - test_image = image.load_img(image_path, target_size=(100, 100)) - test_image = image.img_to_array(test_image) + test_image = keras.preprocessingimage.load_img(image_path, target_size=(100, 100)) + test_image = keras.preprocessingimage.img_to_array(test_image) test_image = np.expand_dims(test_image, axis=0) test_image = test_image / 255.0 # Normalize the image diff --git a/Network/testerVal.py b/Network/testerVal.py index 0868241..8abc29b 100644 --- a/Network/testerVal.py +++ b/Network/testerVal.py @@ -7,7 +7,7 @@ from tensorflow import keras model = keras.models.load_model('trained_model.h5') # Load the class names -class_names = ['Empty', 'Food','People'] +class_names = ['Table', 'Done','Order'] # Load and preprocess the validation dataset data_dir = "Training/"