XAI/VisualCorrespondenceHumanStudy
1
1import os2 3def get_label_for_query(image_url, model_name):4 fourway_label = image_url.split('/')[-2]5 6 if fourway_label=='both_correct':7 return 'Correct'8 9 if fourway_label=='both_wrong':10 return 'Wrong'11 12 if fourway_label == 'chm_correct_knn_incorrect' and model_name == 'CHM':13 return 'Correct'14 elif fourway_label == 'knn_correct_chm_incorrect' and model_name == 'KNN':15 return 'Correct'16 17 return 'Wrong'18 19def get_category(image_url):20 return image_url.split('/')[-2]21 22def translate_winds_to_names(winds):23 return [folder_to_name[x] for x in winds]