(self)
return splits
Create splits for Aircraft and store them in the default path.

    If no split file is provided, and the default location for Aircraft 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 strings (class names).
Create splits for Aircraft and store them in the default path.
Create splits for Aircraft and store them in the default path .
def create_splits(self):
    """Create splits for Aircraft and store them in the default path.

    If no split file is provided, and the default location for Aircraft 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 strings (class names).
    """
    train_inds, valid_inds, test_inds = gen_rand_split_inds(
        self.NUM_TRAIN_CLASSES, self.NUM_VALID_CLASSES, self.NUM_TEST_CLASSES)
    # "Variant" refers to the aircraft model variant (e.g., A330-200) and is
    # used as the class name in the dataset.
    variants_path = os.path.join(self.data_root, 'data', 'variants.txt')
    with tf.io.gfile.GFile(variants_path, 'r') as f:
      variants = [line.strip() for line in f.readlines() if line]
    variants = sorted(variants)
    assert len(variants) == (
        self.NUM_TRAIN_CLASSES + self.NUM_VALID_CLASSES + self.NUM_TEST_CLASSES)

    splits = {
        'train': [variants[i] for i in train_inds],
        'valid': [variants[i] for i in valid_inds],
        'test': [variants[i] for i in test_inds]
    }
    return splits
def create_splits ( self ) : train_inds , valid_inds , test_inds = gen_rand_split_inds ( self . NUM_TRAIN_CLASSES , self . NUM_VALID_CLASSES , self . NUM_TEST_CLASSES ) # "Variant" refers to the aircraft model variant (e.g., A330-200) and is # used as the class name in the dataset. variants_path = os . path . join ( self . data_root , 'data' , 'variants.txt' ) with tf . io . gfile . GFile ( variants_path , 'r' ) as f : variants = [ line . strip ( ) for line in f . readlines ( ) if line ] variants = sorted ( variants ) assert len ( variants ) == ( self . NUM_TRAIN_CLASSES + self . NUM_VALID_CLASSES + self . NUM_TEST_CLASSES ) splits = { 'train' : [ variants [ i ] for i in train_inds ] , 'valid' : [ variants [ i ] for i in valid_inds ] , 'test' : [ variants [ i ] for i in test_inds ] } return splits