diff --git a/modules/deeplearning/srcnn_l1b_l2.py b/modules/deeplearning/srcnn_l1b_l2.py index b3c0d9ed6de04f724d4aa058d08d5a46bcb4c072..eb65e815bcff46060d0dd12c84faa078b5165948 100644 --- a/modules/deeplearning/srcnn_l1b_l2.py +++ b/modules/deeplearning/srcnn_l1b_l2.py @@ -2,7 +2,7 @@ import glob import tensorflow as tf from util.setup import logdir, modeldir, cachepath, now, ancillary_path from util.util import EarlyStop, normalize, denormalize, resample, resample_2d_linear, resample_one,\ - resample_2d_linear_one, get_grid_values_all, add_noise + resample_2d_linear_one, get_grid_values_all, add_noise, smooth_2d, smooth_2d_single import os, datetime import numpy as np import pickle @@ -266,7 +266,10 @@ class SRCNN: # # tmp = resample_2d_linear(x_2, y_2, tmp, t, s) # data_norm.append(tmp) # -------- - tmp = input_data[:, label_idx, slc_y_2, slc_x_2] + #tmp = input_data[:, label_idx, slc_y_2, slc_x_2] + tmp = input_data[:, label_idx, :, :] + tmp = smooth_2d(tmp, sigma=1.5) + tmp = tmp[:, slc_y_2, slc_x_2] if label_param != 'cloud_probability': tmp = normalize(tmp, label_param, mean_std_dct) if DO_ADD_NOISE: @@ -285,7 +288,11 @@ class SRCNN: data = data.astype(np.float32) # ----------------------------------------------------- # ----------------------------------------------------- - label = input_data[:, label_idx, y_128, x_128] + #label = input_data[:, label_idx, y_128, x_128] + label = input_data[:, label_idx, :, :] + label = smooth_2d(label, sigma=1.5) + label = label[:, y_128, x_128] + if label_param != 'cloud_probability': label = normalize(label, label_param, mean_std_dct) else: @@ -755,7 +762,7 @@ def run_evaluate_static(in_file, out_file, ckpt_dir): # grd_b = normalize(grd_b, 'refl_0_65um_nom', mean_std_dct) grd_c = get_grid_values_all(h5f, label_param) - # grd_c = gaussian_filter(grd_c, sigma=1.0) + grd_c = gaussian_filter(grd_c, sigma=1.5) grd_c = grd_c[y_0:y_0+sub_y, x_0:x_0+sub_x] hr_grd_c = grd_c.copy() hr_grd_c = hr_grd_c[y_128, x_128]