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

    If no split file is provided, and the default location for Traffic Sign
    splits does not contain a split file, a
    self.NUM_TRAIN_CLASSES / self.NUM_VALID_CLASSES / self.NUM_TEST_CLASSES
    split is created and 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 Traffic Sign and store them in the default path.
Create splits for Traffic Sign and store them in the default path .
def create_splits(self):
    """Create splits for Traffic Sign and store them in the default path.

    If no split file is provided, and the default location for Traffic Sign
    splits does not contain a split file, a
    self.NUM_TRAIN_CLASSES / self.NUM_VALID_CLASSES / self.NUM_TEST_CLASSES
    split is created and 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.
    """
    # Load class names from the text file
    file_path = TRAFFICSIGN_LABELS_PATH
    with tf.io.gfile.GFile(file_path) as fd:
      all_lines = fd.read()
    # First line is expected to be a comment.
    class_names = all_lines.splitlines()[1:]

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

    splits = {
        'train': [],
        'valid': [],
        'test': [
            '%02d.%s' % (i, class_names[i])
            for i in range(self.NUM_TEST_CLASSES)
        ]
    }
    return splits
def create_splits ( self ) : # Load class names from the text file file_path = TRAFFICSIGN_LABELS_PATH with tf . io . gfile . GFile ( file_path ) as fd : all_lines = fd . read ( ) # First line is expected to be a comment. class_names = all_lines . splitlines ( ) [ 1 : ] err_msg = 'number of classes in dataset does not match split specification' assert len ( class_names ) == self . NUM_TOTAL_CLASSES , err_msg splits = { 'train' : [ ] , 'valid' : [ ] , 'test' : [ '%02d.%s' % ( i , class_names [ i ] ) for i in range ( self . NUM_TEST_CLASSES ) ] } return splits