(self, split, alphabets, alphabets_path)
Parse the data of the given split.

    Specifically, update self.class_names, self.images_per_class, and
    self.classes_per_split with the information for the given split, and
    create and write records of the classes of the given split.

    Args:
      split: an instance of learning_spec.Split
      alphabets: the list of names of alphabets belonging to split
      alphabets_path: the directory with the folders corresponding to alphabets.
Parse the data of the given split.
Parse the data of the given split .
def parse_split_data(self, split, alphabets, alphabets_path):
    """Parse the data of the given split.

    Specifically, update self.class_names, self.images_per_class, and
    self.classes_per_split with the information for the given split, and
    create and write records of the classes of the given split.

    Args:
      split: an instance of learning_spec.Split
      alphabets: the list of names of alphabets belonging to split
      alphabets_path: the directory with the folders corresponding to alphabets.
    """
    # Each alphabet is a superclass.
    for alphabet_folder_name in alphabets:
      alphabet_path = os.path.join(alphabets_path, alphabet_folder_name)
      # Each character is a class.
      for char_folder_name in sorted(tf.io.gfile.listdir(alphabet_path)):
        class_path = os.path.join(alphabet_path, char_folder_name)
        class_label = len(self.class_names)
        class_records_path = os.path.join(
            self.records_path,
            self.dataset_spec.file_pattern.format(class_label))
        self.class_names[class_label] = '{}-{}'.format(alphabet_folder_name,
                                                       char_folder_name)
        self.images_per_class[class_label] = len(
            tf.io.gfile.listdir(class_path))

        # Create and write the tf.Record of the examples of this class.
        write_tfrecord_from_directory(
            class_path, class_label, class_records_path, invert_img=True)

        # Add this character to the count of subclasses of this superclass.
        superclass_label = len(self.superclass_names)
        self.classes_per_superclass[superclass_label] += 1

      # Add this alphabet as a superclass.
      self.superclasses_per_split[split] += 1
      self.superclass_names[superclass_label] = alphabet_folder_name
def parse_split_data ( self , split , alphabets , alphabets_path ) : # Each alphabet is a superclass. for alphabet_folder_name in alphabets : alphabet_path = os . path . join ( alphabets_path , alphabet_folder_name ) # Each character is a class. for char_folder_name in sorted ( tf . io . gfile . listdir ( alphabet_path ) ) : class_path = os . path . join ( alphabet_path , char_folder_name ) class_label = len ( self . class_names ) class_records_path = os . path . join ( self . records_path , self . dataset_spec . file_pattern . format ( class_label ) ) self . class_names [ class_label ] = '{}-{}' . format ( alphabet_folder_name , char_folder_name ) self . images_per_class [ class_label ] = len ( tf . io . gfile . listdir ( class_path ) ) # Create and write the tf.Record of the examples of this class. write_tfrecord_from_directory ( class_path , class_label , class_records_path , invert_img = True ) # Add this character to the count of subclasses of this superclass. superclass_label = len ( self . superclass_names ) self . classes_per_superclass [ superclass_label ] += 1 # Add this alphabet as a superclass. self . superclasses_per_split [ split ] += 1 self . superclass_names [ superclass_label ] = alphabet_folder_name