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