def ReadBBoxPredictFile(file_path):
    """
    Args:
        file path : str

        File format:
            image_name:<image_name.jpg>
                         (percentage) (abs)
            <class_name>,<confidence>,<x1>,<y1>,<x2>,<y2>
            ...
            end

        example:
        image_name:a.jpg
        full,98%,19,30,37,50
        ...
        end

    Returns:
        imgs_bbox : dict

        {img_name1: [bbox1, bbox2, ...],
         img_name2: [bbox1, bbox2, ...],
         ...
        }
    """
    f = open(file_path, 'r')
    imgs_bbox = {}
    img_bbox = []
    imgs_name = []
    for l in f:
        if 'image_name:' in l or 'end' in l:
            if len(img_bbox) != 0:
                img_bbox.sort(key = lambda x: x['conf'], reverse=True)
                imgs_bbox[l] = img_bbox.copy()
                img_bbox = []
            # record image name
            img_name = l.split(':')[-1]
            imgs_name.append(img_name)
        else:
            # Read bboxes!
            l = l.split(',')
            bbox = dict()
            bbox['label'] = l[0]
            bbox['conf'] = float(l[1].split('%')[0])
            bbox['x1'] = int(l[2])
            bbox['y1'] = int(l[3])
            bbox['x2'] = int(l[4])
            bbox['y2'] = int(l[5])

            img_bbox.append(bbox)
    return imgs_bbox