def read_data_names(self):
     """
     Separate the data into train,validation and testing.
     Saves the train,validation and test names into a single file.
     :return:
     """
     train_names = load_names('./' + self.data_name, 'Train Data')
     val_names = load_names('./' + self.data_name, 'Validation Data')
     test_names = load_names('./' + self.data_name, 'Test Data')
     return train_names, val_names, test_names
Example #2
0
 def import_hard_example(self, save_path, number_file):
     hard_example_names = load_names(
         self.path_hard_example_files,
         self.hard_example_texts[number_file].split('.')[0])
     self.hard_example_size = self.sizes[number_file]
     for name in hard_example_names:
         root_name, index1, index2, extension = self.separate_hard_example_name(
             name)
         hard_example_image, hard_example_label = self.get_hard_example(
             root_name, index1, index2, extension)
         save_image_label(save_path, name, hard_example_image,
                          hard_example_label)
Example #3
0
 def read_data_names_folder(self):
     """
     This function reads the data names from the corresponding files
     :return: Returns the names of the data in the corresponding folder together with the folder name
     """
     '''
     This function reads the data names from the corresponding files
     '''
     if self.data == 'Train':
         names = load_names(self.path_data_files, 'Train Data')
         folder = '/Train Predictions'
     elif self.data == 'Validation':
         names = load_names(self.path_data_files, 'Validation Data')
         folder = '/Validation Predictions'
     elif self.data == 'Test':
         names = load_names(self.path_data_files, 'Test Data')
         folder = '/Test Predictions'
     else:
         print("Incorrect data type")
         names = []
         folder = []
     return names, folder