def voc_info(json_dataset):
    # year = json_dataset.name[4:8]
    year = '2012'
    # image_set = json_dataset.name[9:]
    if json_dataset.name.find('trainval') != -1:
        image_set = 'trainval'
    elif json_dataset.name.find('val') != -1:
        image_set = 'val'
    elif json_dataset.name.find('train') != -1:
        image_set = 'train'
    else:
        raise ValueError('dataset name should specify train, val or trainval')
    devkit_path = get_devkit_dir(json_dataset.name)
    assert os.path.exists(devkit_path), \
        'Devkit directory {} not found'.format(devkit_path)
    anno_path = os.path.join(
        devkit_path, 'VOC' + year, 'Annotations', '{:s}.xml')
    image_set_path = os.path.join(
        devkit_path, 'VOC' + year, 'ImageSets', 'Main', image_set + '.txt')
    return dict(
        year=year,
        image_set=image_set,
        devkit_path=devkit_path,
        anno_path=anno_path,
        image_set_path=image_set_path)
Пример #2
0
def voc_info(json_dataset):
    year = json_dataset.name[4:8]
    image_set = json_dataset.name[9:]
    devkit_path = get_devkit_dir(json_dataset.name)
    assert os.path.exists(devkit_path), \
        'Devkit directory {} not found'.format(devkit_path)
    anno_path = os.path.join(devkit_path, 'VOC' + year, 'Annotations',
                             '{:s}.xml')
    image_set_path = os.path.join(devkit_path, 'VOC' + year, 'ImageSets',
                                  'Main', image_set + '.txt')
    return dict(year=year,
                image_set=image_set,
                devkit_path=devkit_path,
                anno_path=anno_path,
                image_set_path=image_set_path)
Пример #3
0
def voc_info(json_dataset):
    year = json_dataset.name[4:8]
    image_set = json_dataset.name[9:]
    devkit_path = get_devkit_dir(json_dataset.name)
    assert os.path.exists(devkit_path), \
        'Devkit directory {} not found'.format(devkit_path)
    anno_path = os.path.join(
        devkit_path, 'VOC' + year, 'Annotations', '{:s}.xml')
    image_set_path = os.path.join(
        devkit_path, 'VOC' + year, 'ImageSets', 'Main', image_set + '.txt')
    return dict(
        year=year,
        image_set=image_set,
        devkit_path=devkit_path,
        anno_path=anno_path,
        image_set_path=image_set_path)