(self,
               name,
               data_root,
               has_superclasses=False,
               records_path=None,
               split_file=None,
               random_seed=22)
Initialize a DatasetConverter.

    Args:
      name: the name of the dataset
      data_root: the root of the dataset
      has_superclasses: Whether the dataset's classes are organized in a two
        level hierarchy of coarse and fine classes. In that case, a
        BiLevelDatasetSpecification will be created.
      records_path: optional path to store the created records. If it's not
        provided, the default path for the dataset will be used.
      split_file: optional path to a file storing the training, validation and
        testing splits of the dataset's classes. If provided, it's a JSON file
        that stores a dictionary whose keys are 'train', 'valid', and 'test' and
        whose values indicate the corresponding classes assigned to these
        splits. Note that not all datasets require a split file. For example it
        may be the case that a dataset indicates the intended assignment of
        classes to splits via their structure (e.g. all train classes live in a
        'train' folder etc).
      random_seed: a random seed used for creating splits (when applicable) in a
        reproducible way.
Initialize a DatasetConverter.
Initialize a DatasetConverter .
def __init__(self,
               name,
               data_root,
               has_superclasses=False,
               records_path=None,
               split_file=None,
               random_seed=22):
    """Initialize a DatasetConverter.

    Args:
      name: the name of the dataset
      data_root: the root of the dataset
      has_superclasses: Whether the dataset's classes are organized in a two
        level hierarchy of coarse and fine classes. In that case, a
        BiLevelDatasetSpecification will be created.
      records_path: optional path to store the created records. If it's not
        provided, the default path for the dataset will be used.
      split_file: optional path to a file storing the training, validation and
        testing splits of the dataset's classes. If provided, it's a JSON file
        that stores a dictionary whose keys are 'train', 'valid', and 'test' and
        whose values indicate the corresponding classes assigned to these
        splits. Note that not all datasets require a split file. For example it
        may be the case that a dataset indicates the intended assignment of
        classes to splits via their structure (e.g. all train classes live in a
        'train' folder etc).
      random_seed: a random seed used for creating splits (when applicable) in a
        reproducible way.
    """
    self.name = name
    self.data_root = data_root
    self.has_superclasses = has_superclasses
    self.seed = random_seed
    if records_path is None:
      records_path = os.path.join(FLAGS.records_root, name)
    tf.io.gfile.makedirs(records_path)
    self.records_path = records_path

    # Where to write the DatasetSpecification instance.
    self.dataset_spec_path = os.path.join(self.records_path,
                                          'dataset_spec.json')

    self.split_file = split_file
    if self.split_file is None:
      self.split_file = os.path.join(FLAGS.splits_root,
                                     '{}_splits.json'.format(self.name))
      tf.io.gfile.makedirs(FLAGS.splits_root)

    # Sets self.dataset_spec to an initial DatasetSpecification or
    # BiLevelDatasetSpecification.
    self._init_specification()
def __init__ ( self , name , data_root , has_superclasses = False , records_path = None , split_file = None , random_seed = 22 ) : self . name = name self . data_root = data_root self . has_superclasses = has_superclasses self . seed = random_seed if records_path is None : records_path = os . path . join ( FLAGS . records_root , name ) tf . io . gfile . makedirs ( records_path ) self . records_path = records_path # Where to write the DatasetSpecification instance. self . dataset_spec_path = os . path . join ( self . records_path , 'dataset_spec.json' ) self . split_file = split_file if self . split_file is None : self . split_file = os . path . join ( FLAGS . splits_root , '{}_splits.json' . format ( self . name ) ) tf . io . gfile . makedirs ( FLAGS . splits_root ) # Sets self.dataset_spec to an initial DatasetSpecification or # BiLevelDatasetSpecification. self . _init_specification ( )