def dataset_Leaf(self):
     """
     Create the data for the Foliage Dataset
     :return:
     """
     self.create_data_base()
     self.make_directories("other")
     print("Create id Text File ...")
     id_d = Make_Id_Species.Set_Id_Species(self.p + "train/",
                                           self.path_database["data"])
     id_d.set_list_id()
     id_d.set_id_dic()
     print("Create File ...")
     for directories_data in ["normalization", "augmentation"]:
         self.m_dir.make_directories(id_d.path_dict,
                                     self.path_database[directories_data])
     print("Normalize ...")
     norm_train = Normalization.Normalize(
         self.p + "train/", self.path_database["normalization"])
     norm_train.normalize_dimension_image()
     print("Augmentation ...")
     d_augm = Data_Augmentation.Data_Augmentation(
         self.path_database["normalization"],
         self.path_database["augmentation"])
     d_augm.create_augmentation(False)
     print("Normalize Validation...")
     shutil.rmtree(self.path_database["normalization"])
     os.makedirs(self.a + "normalization/")
     self.m_dir.make_directories(id_d.path_dict,
                                 self.path_database["normalization"])
     norm_test = Normalization.Normalize(
         self.p + "validation/", self.path_database["normalization"])
     norm_test.normalize_dimension_image()
     norm_test.reduce()
     m_file = Make_train_val_file()
     print("Create Text File ...")
     path_for_val_train = {
         "train": "augmentation",
         "validation": "normalization"
     }
     for i in path_for_val_train:
         m_file.make_file(self.path_database[path_for_val_train[i]],
                          self.path_database["data"] + i + ".txt",
                          id_d.path_dict)
     self.lmdb_build.set_lmdb(self.path_database, self.a,
                              self.caffe_path + "build/tools")
     mean = Create_Mean()
     mean.make_mean(self.a, self.a + "lmdb/",
                    self.caffe_path + "build/tools")
예제 #2
0
def main():
    print('My name is Abhishek Sinha')
    obj = Normalization.Normalize()
    obj.generateData()