def get_ground_truth_fromtxt(gtfile_path):
    """
    :param filename: file contains the imagename and label number
    :return: dictionary key imagename, value is label number
    """
    img_gt_dict = dict()
    with open(gtfile_path, 'r')as f:
        for line in f.readlines():
            label_list = line.strip().split(" ")
            img_name = label_list[0].split(".")[0]
            img_lab = label_list[-1]
            img_gt_dict[img_name] = img_lab
    return img_gt_dict