def __init__(self): gs = globalsetting() self.cuda_id = [0, 0] self.save_route = os.path.join(gs.ckpt_path, 'temp') self.flow_feat_scales = 5 # total scales of features self.flow_scale_times = 2 # output scale for flow map, 0 for non-scale, [0, flow_feat_scales-1] self.flow_base_filters = 128 self.flow_max_filters = 128 self.flow_downsample = 'pool' self.learing_rate = 1e-3 self.rand_offset = 5 self.totalvar = 2e-5 # 2e-3 for L2sq self.ssim = 1e-5 self.photometric = 1e-3 self.smoothness_type = 'L1' # 'L2sq' self.rot_inv_type = 'rot' # 'rot': rotation of 180 degree / 'neg': negative image self.debug = False # if True, save training results every epoch self.interval_test = 100 self.interval_save_ckpt = 100 self.total_epoch = int(5e4) self.checkpoint_recovery = None self.grid_size = 40 # int(np.ceil(768./5)) self.style_target = os.path.join(gs.data_path, 'HRF/manual1/12_h.tif') self.dataset_path = os.path.join( gs.data_path, 'Fundus Fluorescein Angiogram Photographs & Colour Fundus Images of Diabetic Patients' ) self.csv_path = os.path.join(gs.proj_path, 'FFAPCFIDP_affine.csv') self.save_codes = '' self.rand_offset_folder = None # not for training self.mode = 'train' # 'eval' on specified data / 'test' on outside data self.save_im = False # save image during 'train' or 'eval'
import numpy as np import os, time import scipy.io as sio from RetSegReg import options, RetSegReg from globalsetting import globalsetting torch.manual_seed(2019) torch.cuda.manual_seed_all(2019) np.random.seed(2019) os.environ['OMP_NUM_THREADS'] = '1' torch.backends.cudnn.deterministic = True torch.backends.cudnn.benchmark = False gs = globalsetting() opt = options() opt.cuda_id = 0 opt.save_route = '' opt.flow_feat_scales = 5 opt.flow_scale_times = 2 opt.flow_base_filters = 128 opt.flow_max_filters = 128 opt.flow_downsample = 'pool' opt.rand_offset_folder = os.path.join( gs.ckpt_path, 'FFAPCFIDP_random_offset') # not for training opt.mode = 'eval' opt.save_im = False