test_label_file = open(os.path.join('label_data', 'test_complete_file.txt'),
                       'r')
for line in test_label_file.readlines():
    line_input = line.split(" ")
    label_dict_test[line_input[0]] = line_input[2].rstrip()
test_label_file.close()

test_labels = []
test_features = np.empty((len(files), 60))
for i, file in enumerate(files):
    # Get label for file
    file_name = file
    # Extract lip as 60x80 image
    file = os.path.join('test_data', file)
    fe = FeatureExtractor.from_image(file)
    fe.face_detect()
    fe.landmark_detect()
    fe.crop_lips()
    # print("File {} lips extracted.".format(i))

    # Convert lip image to 60-dimensional feature vector
    if fe.lips is None:
        print("File {} skipped, lips could not be found.".format(i))
        continue
    filters = MSA.multiscale_full(fe.lips[0].flatten('F'))
    differences = filters[1:] - filters[:-1]
    test_features[i] = np.sum(differences, 1)
    test_labels.append(label_dict_test[file_name])

    # print("File {} complete.".format(i))