(self)
return splits
Create splits for CU-Birds and store them in the default path.

    If no split file is provided, and the default location for CU-Birds splits
    does not contain a split file, splits are randomly created in this
    function using 70%, 15%, and 15% of the data for training, validation and
    testing, respectively, and then stored in that default location.

    Returns:
      The splits for this dataset, represented as a dictionary mapping each of
      'train', 'valid', and 'test' to a list of class names.
Create splits for CU-Birds and store them in the default path.
Create splits for CU - Birds and store them in the default path .
def create_splits(self):
    """Create splits for CU-Birds and store them in the default path.

    If no split file is provided, and the default location for CU-Birds splits
    does not contain a split file, splits are randomly created in this
    function using 70%, 15%, and 15% of the data for training, validation and
    testing, respectively, and then stored in that default location.

    Returns:
      The splits for this dataset, represented as a dictionary mapping each of
      'train', 'valid', and 'test' to a list of class names.
    """

    with tf.io.gfile.GFile(os.path.join(self.data_root, 'classes.txt'),
                           'r') as f:
      class_names = []
      for lines in f:
        _, class_name = lines.strip().split(' ')
        class_names.append(class_name)

    err_msg = 'number of classes in dataset does not match split specification'
    assert len(class_names) == self.NUM_TOTAL_CLASSES, err_msg

    train_inds, valid_inds, test_inds = gen_rand_split_inds(
        self.NUM_TRAIN_CLASSES, self.NUM_VALID_CLASSES, self.NUM_TEST_CLASSES)
    splits = {
        'train': [class_names[i] for i in train_inds],
        'valid': [class_names[i] for i in valid_inds],
        'test': [class_names[i] for i in test_inds]
    }
    return splits
def create_splits ( self ) : with tf . io . gfile . GFile ( os . path . join ( self . data_root , 'classes.txt' ) , 'r' ) as f : class_names = [ ] for lines in f : _ , class_name = lines . strip ( ) . split ( ' ' ) class_names . append ( class_name ) err_msg = 'number of classes in dataset does not match split specification' assert len ( class_names ) == self . NUM_TOTAL_CLASSES , err_msg train_inds , valid_inds , test_inds = gen_rand_split_inds ( self . NUM_TRAIN_CLASSES , self . NUM_VALID_CLASSES , self . NUM_TEST_CLASSES ) splits = { 'train' : [ class_names [ i ] for i in train_inds ] , 'valid' : [ class_names [ i ] for i in valid_inds ] , 'test' : [ class_names [ i ] for i in test_inds ] } return splits