HR_inten_batch_input=tf.placeholder(tf.float32,HR_batch_dims) LR_depth_batch_input=tf.placeholder(tf.float32,LR_batch_dims) coar_inter_dep_batch=tf.image.resize_images(LR_depth_batch_input,tf.constant(HR_patch_size,dtype=tf.int32),tf.image.ResizeMethod.BICUBIC) #gen_network construction with tf.variable_scope("gen_inten"): guided_ten=gslb.inten_feature_extraction_unit(HR_inten_batch_input,phase_train=phase_train) with tf.variable_scope("gen_down1_inten"): guided_4xto2x_gen=gslb.inten_downsample_unit(guided_ten, phase_train=phase_train) with tf.variable_scope("gen_down2_inten"): guided_8xto4x_gen=gslb.inten_downsample_unit(guided_4xto2x_gen, phase_train=phase_train) with tf.variable_scope("gen_dep"): dep_ten=gslb.LR_dep_feature_extraction_uint(LR_depth_batch_input,phase_train=phase_train) dep_ten=gslb.LR_dep_upsampling_unit(dep_ten, phase_train=phase_train) with tf.variable_scope("gen_up3_dep"): dep_ten=gslb.LR_dep_fusion_unit(dep_ten, guided_8xto4x_gen, phase_train=phase_train) dep_ten=gslb.LR_dep_upsampling_unit(dep_ten, phase_train=phase_train) with tf.variable_scope("gen_up2_dep"): dep_ten=gslb.LR_dep_fusion_unit(dep_ten, guided_4xto2x_gen, phase_train=phase_train) dep_ten=gslb.LR_dep_upsampling_unit(dep_ten, phase_train=phase_train) with tf.variable_scope("gen_8x_last4_layers"): gen_ten=gslb.LR_dep_fusion_unit(dep_ten, guided_ten,phase_train=phase_train) gen_ten=gslb.LR_recon_unit(gen_ten, coar_inter_dep_batch,phase_train=phase_train) #define loss for gen loss=tf.reduce_mean(tf.squared_difference(gen_ten,HR_depth_batch_input)) saver_full=tf.train.Saver() #begin comp_gen testing with tf.Session() as sess: model_path="/media/kenny/Data/trained_models/residual_bn_csvt_models/noise_free/8x/full_model1/8x_nf_full_model.ckpt-98"
LR_depth_batch_input = tf.placeholder(tf.float32, LR_batch_dims) coar_inter_dep_batch = tf.image.resize_images( LR_depth_batch_input, tf.constant(HR_patch_size, dtype=tf.int32), tf.image.ResizeMethod.BICUBIC) #gen_network construction with tf.variable_scope("gen_inten"): guided_ten = gslb.inten_feature_extraction_unit(HR_inten_batch_input, phase_train=phase_train) with tf.variable_scope("gen_dep"): dep_ten = gslb.LR_dep_feature_extraction_uint(LR_depth_batch_input, phase_train=phase_train) dep_ten = gslb.LR_dep_upsampling_unit(dep_ten, phase_train=phase_train) with tf.variable_scope("gen_2x_last4_layers"): gen_ten = gslb.LR_dep_fusion_unit(dep_ten, guided_ten, phase_train=phase_train) gen_ten = gslb.LR_recon_unit(gen_ten, coar_inter_dep_batch, phase_train=phase_train) #define loss for gen loss = tf.reduce_mean(tf.squared_difference(gen_ten, HR_depth_batch_input)) train_op_small = tf.train.AdamOptimizer(1e-5).minimize(loss) train_op_large = tf.train.AdamOptimizer(1e-4).minimize(loss) #initial net and saver object #var_list=tf.trainable_variables() #gen_dep_vars = [v for v in var_list if v.name.startswith("gen_dep")] #gen_inten_vars=[v for v in var_list if v.name.startswith("gen_inten")] #saving_var_list=gen_dep_vars+gen_inten_vars