test_image_file = [] test_folders = [ 'SingleOneTest', 'SingleTwoTest', 'SingleThreeTest', 'SingleFourTest', 'SingleFiveTest', 'SingleSixTest', 'SingleSevenTest', 'SingleEightTest' ] for folder in test_folders: test_image_file = test_image_file + os.listdir('../EgoGesture Dataset/' + folder + '/') print('# of images for performance analysis: ', len(test_image_file)) """ Key points Detection """ model = model() model.summary() model.load_weights('weights/performance.h5') def classify(image): image = np.asarray(image) image = cv2.resize(image, (128, 128)) image = image.astype('float32') image = image / 255.0 image = np.expand_dims(image, axis=0) probability, position = model.predict(image) probability = probability[0] position = position[0] return probability, position def class_finder(prob):
import time import numpy as np from statistics import mean from net.network import model from preprocess.label_gen_test import label_generator_testset test_image_file = [] test_folders = ['SingleOneTest', 'SingleTwoTest', 'SingleThreeTest', 'SingleFourTest', 'SingleFiveTest'] for folder in test_folders: test_image_file = test_image_file + os.listdir('../EgoGesture Dataset/' + folder + '/') """ Key points Detection """ model = model() model.summary() model.load_weights('weights/comparison.h5') def classify(image): image = np.asarray(image) image = cv2.resize(image, (128, 128)) image = image.astype('float32') image = image / 255.0 image = np.expand_dims(image, axis=0) probability, position = model.predict(image) probability = probability[0] position = position[0] return probability, position def class_finder(prob):