def loadModels(self): self.mer = mc.MergeChannels(equalize=True) self.Mod = cm.createOpticDiscModel("SAB700_NODECAY", gray=False, preprocessFunc=self.mer.Merge) self.Mod.model.predict( np.zeros(shape=(1, self.Mod.rowDim, self.Mod.colDim, self.Mod.channels), dtype=np.float32)) self.ModAtrophy = cm.createAtophyModel("Gray50") self.ModAtrophy.model.predict( np.zeros(shape=(1, self.ModAtrophy.rowDim, self.ModAtrophy.colDim, self.ModAtrophy.channels), dtype=np.float32)) self.ModExit = cm.createExitModel("Gray125") self.ModExit.model.predict( np.zeros(shape=(1, self.ModExit.rowDim, self.ModExit.colDim, self.ModExit.channels), dtype=np.float32))
class_mode = 'mask' # model show_function = md.Models.model_show_function read_function = moil.read_and_size validate_path_provider_func = morn.next_path validate_start_path = base_path + 'Images/' + FeatureName + 'Validate/' filters = 12 load_weights = True save_modulo = 100 weights_path = "../weights/unet" + TrainModeName var_filename = "../weights/var" + TrainModeName + ".txt" validate = True mer = mc.MergeChannels(True) validatePreprocessFunc = mer.Merge draw = True sumTimes = 100 check_perf_times = 0 check_perf_times_in_loop = 0 loop_modulo = 1 learn_rate = 3e-04 decay_rate = 4e-04 printDecay = True collectLoss = True Augment = True # setup
import random import shutil import os import Code.Preprocessing.image_creation.BuildMasksRepo as bmr import Code.Preprocessing.image_creation.BuildRepo as br import Code.Preprocessing.MergeChannels as mc if __name__ == "__main__": level = 20 scale = 0.75 equalize = True mer = mc.MergeChannels(equalize) repo_base = "../Images/" repo_name = "all" new_name = "TarczaSAB700" shared_mask_data_filename = 'maskDataTrain700.csv' if os.path.exists(repo_base + repo_name + '/maskData.csv'): shutil.copyfile( repo_base + repo_name + '/maskData.csv', repo_base + repo_name + '/maskData_copyFile' + str(random.randint(0, 10000)) + '.csv') shutil.copyfile("../SharedMaskData/" + shared_mask_data_filename, repo_base + repo_name + '/maskData.csv') onlyMasked = True override = True obj = br.BuildRepo(repo_base, repo_name, new_name, level, scale, mer.Merge, onlyMasked, override) obj.Build()
from Code.Libraries import MyOculusRepoNav as morn from Code.Preprocessing import MergeChannels as mh path = '../../../Images/all/' merge = mh.MergeChannels(equalize=True, testMode=True) morn.all_path(merge.MergeOnPath, path)