import os from segment_key import final_features image_dir = '../augmentation/testing/3' for filename in os.listdir(image_dir): if filename.endswith('.jpg'): image_path = os.path.join(image_dir, filename) features = final_features(image_path) with open('./prediction/database.txt', 'a+') as f: f.write(filename + ';' + str(features) + '\n') print('successfully predicted ' + filename)