def line2dict_func(line, image_id, category2id):
    """
    例: xxx.jpg,w,h,238,159,720,538,腹部,非标准,238,159,720,538,腹部,非标准,...
    Args:
        line: str
        image_id: str or int ,该图的唯一标识

    Return : dict, with fields:
                -file_name: str
                -width,height: int
                -image_id: str or int , 该图的唯一标识
                -annotations: list[dict], where dict with fields:
                        -bbox: list[float]
                        -category_id: int
    """
    file_name, width, height, *items = line.strip().split(',')
    width = int(width)
    height = int(height)
    annotations = []
    for i in range(0, len(items), 6):
        bbox = [float(it) for it in items[i:i + 4]]
        category_id = category2id['{}_{}'.format(items[i + 4], items[i + 5])]
        dic = {'bbox': bbox, 'category_id': category_id}
        annotations.append(dic)

    return {'file_name': file_name, 'width': width, 'height': height, 'image_id': image_id,
            'annotations': annotations}