Skip to content
Snippets Groups Projects
Commit f840b10d authored by tomrink's avatar tomrink
Browse files

snapshot...

parent fc176755
No related branches found
No related tags found
No related merge requests found
...@@ -69,8 +69,8 @@ KERNEL_SIZE = 3 # target size: (128, 128) ...@@ -69,8 +69,8 @@ KERNEL_SIZE = 3 # target size: (128, 128)
N_X = N_Y = 1 N_X = N_Y = 1
if KERNEL_SIZE == 3: if KERNEL_SIZE == 3:
slc_x = slice(2, N_X*128 + 4) slc_x = slice(3, N_X*128 + 5)
slc_y = slice(2, N_Y*128 + 4) slc_y = slice(3, N_Y*128 + 5)
slc_x_2 = slice(1, int((N_X*128)/2) + 4) slc_x_2 = slice(1, int((N_X*128)/2) + 4)
slc_y_2 = slice(1, int((N_Y*128)/2) + 4) slc_y_2 = slice(1, int((N_Y*128)/2) + 4)
x_2 = np.arange(int((N_X*128)/2) + 3) x_2 = np.arange(int((N_X*128)/2) + 3)
...@@ -79,8 +79,8 @@ if KERNEL_SIZE == 3: ...@@ -79,8 +79,8 @@ if KERNEL_SIZE == 3:
s = np.arange(0, int((N_Y*128)/2) + 3, 0.5) s = np.arange(0, int((N_Y*128)/2) + 3, 0.5)
x_k = slice(1, N_X*128 + 3) x_k = slice(1, N_X*128 + 3)
y_k = slice(1, N_Y*128 + 3) y_k = slice(1, N_Y*128 + 3)
x_128 = slice(3, N_X*128 + 3) x_128 = slice(4, N_X*128 + 4)
y_128 = slice(3, N_Y*128 + 3) y_128 = slice(4, N_Y*128 + 4)
elif KERNEL_SIZE == 5: elif KERNEL_SIZE == 5:
slc_x = slice(3, 135) slc_x = slice(3, 135)
slc_y = slice(3, 135) slc_y = slice(3, 135)
...@@ -301,17 +301,20 @@ class SRCNN: ...@@ -301,17 +301,20 @@ class SRCNN:
tmp = input_label[:, idx, :, :] tmp = input_label[:, idx, :, :]
tmp = np.where(np.isnan(tmp), 0, tmp) tmp = np.where(np.isnan(tmp), 0, tmp)
lo, hi, std, avg = get_min_max_std(tmp) # lo, hi, std, avg = get_min_max_std(tmp)
lo = upsample_nearest(lo) # lo = upsample_nearest(lo)
hi = upsample_nearest(hi) # hi = upsample_nearest(hi)
avg = upsample_nearest(avg) # avg = upsample_nearest(avg)
lo = normalize(lo, param, mean_std_dct) # lo = normalize(lo, param, mean_std_dct)
hi = normalize(hi, param, mean_std_dct) # hi = normalize(hi, param, mean_std_dct)
avg = normalize(avg, param, mean_std_dct) # avg = normalize(avg, param, mean_std_dct)
#
data_norm.append(lo[:, slc_y, slc_x]) # data_norm.append(lo[:, slc_y, slc_x])
data_norm.append(hi[:, slc_y, slc_x]) # data_norm.append(hi[:, slc_y, slc_x])
data_norm.append(avg[:, slc_y, slc_x]) # data_norm.append(avg[:, slc_y, slc_x])
tmp = normalize(tmp, param, mean_std_dct)
data_norm.append(tmp[:, slc_y, slc_x])
# --------------------------------------------------- # ---------------------------------------------------
tmp = input_data[:, label_idx, :, :] tmp = input_data[:, label_idx, :, :]
tmp = np.where(np.isnan(tmp), 0, tmp) tmp = np.where(np.isnan(tmp), 0, tmp)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment