validation_dict = data.create_set('data/test') transcriptions_dict = data.get_transcriptions(folder_unprocessed + '/ground-truth/transcription.txt') print("Number of element in the validation dict: %d" % len(validation_dict)) output_lines = [] for keyword in keywords: data = keyword.split(',') output_line = [data[0]] score_dict = {} image = training_dict[data[1]] dtw_o = DTW(image) i = 0 for key, image2 in validation_dict.items(): score = dtw_o.calculate_cost(image2) score_dict[key] = score i += 1 if i % 100 == 0: print(i) sorted_score = dict(sorted(score_dict.items(), key = operator.itemgetter(1))) for name, score in sorted_score.items(): output_line.append(name) output_line.append(score) output_lines.append(output_line) # for key, image in validation_dict.items(): # dtw_o = DTW(image) # output_line = [key] # score_dict = {} # i = 0