(self)
Implements DatasetConverter.create_dataset_specification_and_records().

    We use Lake's original train/test splits as we believe this is a more
    challenging setup and because we like that it's hierarchically structured.
    We also held out a subset of that train split to act as our validation set.
    Specifically, the 5 alphabets from that set with the least number of
    characters were chosen for this purpose.
Implements DatasetConverter.create_dataset_specification_and_records().
Implements DatasetConverter . create_dataset_specification_and_records () .
def create_dataset_specification_and_records(self):
    """Implements DatasetConverter.create_dataset_specification_and_records().

    We use Lake's original train/test splits as we believe this is a more
    challenging setup and because we like that it's hierarchically structured.
    We also held out a subset of that train split to act as our validation set.
    Specifically, the 5 alphabets from that set with the least number of
    characters were chosen for this purpose.
    """

    # We chose the 5 smallest alphabets (i.e. those with the least characters)
    # out of the 'background' set of alphabets that are intended for train/val
    # We keep the 'evaluation' set of alphabets for testing exclusively
    # The chosen alphabets have 14, 14, 16, 17, and 20 characters, respectively.
    validation_alphabets = [
        'Blackfoot_(Canadian_Aboriginal_Syllabics)',
        'Ojibwe_(Canadian_Aboriginal_Syllabics)',
        'Inuktitut_(Canadian_Aboriginal_Syllabics)', 'Tagalog',
        'Alphabet_of_the_Magi'
    ]

    training_alphabets = []
    data_path_trainval = os.path.join(self.data_root, 'images_background')
    for alphabet_name in sorted(tf.io.gfile.listdir(data_path_trainval)):
      if alphabet_name not in validation_alphabets:
        training_alphabets.append(alphabet_name)
    assert len(training_alphabets) + len(validation_alphabets) == 30

    data_path_test = os.path.join(self.data_root, 'images_evaluation')
    test_alphabets = sorted(tf.io.gfile.listdir(data_path_test))
    assert len(test_alphabets) == 20

    self.parse_split_data(learning_spec.Split.TRAIN, training_alphabets,
                          data_path_trainval)
    self.parse_split_data(learning_spec.Split.VALID, validation_alphabets,
                          data_path_trainval)
    self.parse_split_data(learning_spec.Split.TEST, test_alphabets,
                          data_path_test)
def create_dataset_specification_and_records ( self ) : # We chose the 5 smallest alphabets (i.e. those with the least characters) # out of the 'background' set of alphabets that are intended for train/val # We keep the 'evaluation' set of alphabets for testing exclusively # The chosen alphabets have 14, 14, 16, 17, and 20 characters, respectively. validation_alphabets = [ 'Blackfoot_(Canadian_Aboriginal_Syllabics)' , 'Ojibwe_(Canadian_Aboriginal_Syllabics)' , 'Inuktitut_(Canadian_Aboriginal_Syllabics)' , 'Tagalog' , 'Alphabet_of_the_Magi' ] training_alphabets = [ ] data_path_trainval = os . path . join ( self . data_root , 'images_background' ) for alphabet_name in sorted ( tf . io . gfile . listdir ( data_path_trainval ) ) : if alphabet_name not in validation_alphabets : training_alphabets . append ( alphabet_name ) assert len ( training_alphabets ) + len ( validation_alphabets ) == 30 data_path_test = os . path . join ( self . data_root , 'images_evaluation' ) test_alphabets = sorted ( tf . io . gfile . listdir ( data_path_test ) ) assert len ( test_alphabets ) == 20 self . parse_split_data ( learning_spec . Split . TRAIN , training_alphabets , data_path_trainval ) self . parse_split_data ( learning_spec . Split . VALID , validation_alphabets , data_path_trainval ) self . parse_split_data ( learning_spec . Split . TEST , test_alphabets , data_path_test )