Beispiel #1
0
def get_split(split_name, dataset_dir, file_pattern=None, reader=None):
    """Gets a dataset tuple with instructions for reading ImageNet.

    Args:
      split_name: A train/test split name.
      dataset_dir: The base directory of the dataset sources.
      file_pattern: The file pattern to use when matching the dataset sources.
        It is assumed that the pattern contains a '%s' string so that the split
        name can be inserted.
      reader: The TensorFlow reader type.

    Returns:
      A `Dataset` namedtuple.

    Raises:
        ValueError: if `split_name` is not a valid train/test split.
    """
    if not file_pattern:
        file_pattern = FILE_PATTERN  # 需要文件命名格式满足:'voc_2012_%s_*.tfrecord'
    return pascalvoc_common.get_split(
        split_name,
        dataset_dir,
        file_pattern,
        reader,
        SPLITS_TO_SIZES,  # {'train': 17125,}
        ITEMS_TO_DESCRIPTIONS,
        NUM_CLASSES  # 20
    )
Beispiel #2
0
def get_dataset(split_name,
                dataset_dir,
                batch_size,
                image_shape,
                num_epoch,
                file_pattern=None,
                reader=None):
    """Gets a dataset tuple with instructions for reading ImageNet.

    Args:
      dataset_name: A train/test split name.
      dataset_dir: The base directory of the dataset sources.
      file_pattern: The file pattern to use when matching the dataset sources.
        It is assumed that the pattern contains a '%s' string so that the split
        name can be inserted.
      reader: The TensorFlow reader type.

    Returns:
      A `Dataset` namedtuple.

    Raises:
        ValueError: if `split_name` is not a valid train/test split.
    """
    if not file_pattern:
        file_pattern = FILE_PATTERN
    return pascalvoc_common.get_split(split_name, dataset_dir, batch_size,
                                      image_shape, num_epoch, file_pattern,
                                      SPLITS_TO_SIZES, ITEMS_TO_DESCRIPTIONS,
                                      NUM_CLASSES)
Beispiel #3
0
def get_split(split_name, dataset_dir, file_pattern=None, reader=None):
    """
    Gets a dataset tuple with instructions for reading image.
    :param split_name:
    :param dataset_dir:
    :param file_pattern:
    :param reader:
    :return:
        A `Dataset` namedtuple.
    ":raise
        ValueError: if `split_name` is not a valid train/test split.
    """
    if not file_pattern:
        file_pattern = FILE_PATTERN
    return pascalvoc_common.get_split(split_name, dataset_dir, file_pattern,
                                      reader, SPLITS_TO_SIZES,
                                      ITEMS_TO_DESCRIPTIONS, NUM_CLASSES)
Beispiel #4
0
def get_split(split_name, dataset_dir, file_pattern=None, reader=None):
    """
    Gets a dataset tuple with instructions for reading ImageNet.

    :param split_name: A train/test split name.
    :param dataset_dir: The base directory of the dataset sources.
    :param file_pattern: The file pattern to use when matching the dataset sources.
        It is assumed that the pattern contains a '%s' string so that the split
        name can be inserted.
    :param reader: The TensorFlow reader type.
    :return:
        A `Dataset` namedtuple.
    :raises:
        ValueError: If `split_name` is not a valid train/test split.
    """
    if not file_pattern:
        file_pattern = FILE_PATTERN  # 'voc_2007_%s_*.tfrecord'
    return pascalvoc_common.get_split(split_name, dataset_dir, file_pattern,
                                      reader, SPLITS_TO_SIZES,
                                      ITEMS_TO_DESCRIPTION, NUM_CLASSES)
def get_split(split_name, dataset_dir, file_pattern=None, reader=None):
    """Gets a dataset tuple with instructions for reading ImageNet.

    Args:
      split_name: A train/test split name.
      dataset_dir: The base directory of the dataset sources.
      file_pattern: The file pattern to use when matching the dataset sources.
        It is assumed that the pattern contains a '%s' string so that the split
        name can be inserted.
      reader: The TensorFlow reader type.

    Returns:
      A `Dataset` namedtuple.

    Raises:
        ValueError: if `split_name` is not a valid train/test split.
    """
    if not file_pattern:
        file_pattern = FILE_PATTERN
    return pascalvoc_common.get_split(split_name, dataset_dir,
                                      file_pattern, reader,
                                      SPLITS_TO_SIZES,
                                      ITEMS_TO_DESCRIPTIONS,
                                      NUM_CLASSES)
def get_split(split_name, dataset_dir, file_pattern=None, reader=None):
    """Gets a dataset tuple with instructions for reading ImageNet.  得到一个数据集元组

    Args:
      split_name: A train/test split name.       训练集或者测试集
      dataset_dir: The base directory of the dataset sources.    数据集的目录
      file_pattern: The file pattern to use when matching the dataset sources.    当匹配数据集资源的时候使用
        It is assumed that the pattern contains a '%s' string so that the split
        name can be inserted.
      reader: The TensorFlow reader type.                  tensorflow读取器的类型

    Returns:
      A `Dataset` namedtuple.                        返回一个'Dateset'的命名元组

    Raises:
        ValueError: if `split_name` is not a valid train/test split.
    """
    if not file_pattern:
        file_pattern = FILE_PATTERN
    return pascalvoc_common.get_split(split_name, dataset_dir,
                                      file_pattern, reader,
                                      SPLITS_TO_SIZES,
                                      ITEMS_TO_DESCRIPTIONS,
                                      NUM_CLASSES)