diff --git a/modules/deeplearning/srcnn_l1b_l2.py b/modules/deeplearning/srcnn_l1b_l2.py index 6c82da3e528cae756ce0dd3644a5e92244cd8325..1c0b9780b68eedd3b2e5c6204b87f28c49fe122e 100644 --- a/modules/deeplearning/srcnn_l1b_l2.py +++ b/modules/deeplearning/srcnn_l1b_l2.py @@ -36,6 +36,7 @@ NOISE_TRAINING = False NOISE_STDDEV = 0.01 DO_AUGMENT = True +DO_SMOOTH = False DO_ZERO_OUT = False DO_ESPCN = False # Note: If True, cannot do mixed resolution input fields (Adjust accordingly below) @@ -267,7 +268,6 @@ class SRCNN: tmp = input_data[:, idx, :, :] tmp = tmp.copy() tmp = np.where(np.isnan(tmp), 0, tmp) - # tmp = smooth_2d(tmp, sigma=1.0) if DO_ESPCN: tmp = tmp[:, slc_y_2, slc_x_2] else: # Half res upsampled to full res: @@ -282,7 +282,6 @@ class SRCNN: tmp = input_data[:, idx, :, :] tmp = tmp.copy() tmp = np.where(np.isnan(tmp), 0, tmp) - # tmp = smooth_2d(tmp, sigma=1.0) # Full res: tmp = tmp[:, slc_y, slc_x] tmp = normalize(tmp, param, mean_std_dct) @@ -293,7 +292,8 @@ class SRCNN: tmp = input_data[:, label_idx, :, :] tmp = tmp.copy() tmp = np.where(np.isnan(tmp), 0, tmp) - # tmp = smooth_2d(tmp, sigma=1.0) + if DO_SMOOTH: + tmp = smooth_2d(tmp, sigma=0.5) if DO_ESPCN: tmp = tmp[:, slc_y_2, slc_x_2] else: # Half res upsampled to full res: @@ -315,8 +315,9 @@ class SRCNN: # ----------------------------------------------------- label = input_data[:, label_idx, :, :] label = label.copy() - # label = np.where(np.isnan(label), 0, label) - # label = smooth_2d(label, sigma=1.0) + if DO_SMOOTH: + label = np.where(np.isnan(label), 0, label) + label = smooth_2d(label, sigma=0.5) label = label[:, y_128, x_128] if label_param != 'cloud_probability':