def parse_data_cfg(path):
    """
    解析数据集的配置文件
    # 类别数目
    classes= 80
    # 训练集ID文件路径
    train=../coco/trainvalno5k.txt
    # 验证集ID文件路径
    valid=../coco/5k.txt
    # 类别名称文件路径
    names=data/coco.names
    backup=backup/
    eval=coco
    :param path: 'config/oxfordhand.data'
    :return:
    """
    # Parses the data configuration file
    options = dict()
    with open(path, 'r') as fp:
        lines = fp.readlines() # 返回列表，包含所有的行。

    for line in lines: # 'classes= 1\n'
        line = line.strip()
        if line == '' or line.startswith('#'): # 去掉空白行和以#开头的注释行
            continue
        key, val = line.split('=') # 按等号分割 key:'classes'  value:' 1'
        options[key.strip()] = val.strip()

    return options