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

snapshot...

parent 6fa5af8f
No related branches found
No related tags found
No related merge requests found
...@@ -514,11 +514,7 @@ class SRCNN: ...@@ -514,11 +514,7 @@ class SRCNN:
def test_step(self, mini_batch): def test_step(self, mini_batch):
inputs = [mini_batch[0]] inputs = [mini_batch[0]]
labels = mini_batch[1] labels = mini_batch[1]
in_nd = tf.make_ndarray(mini_batch[0])
print('****: ', in_nd.shape, in_nd.min(), in_nd.max())
pred = self.model(inputs, training=False) pred = self.model(inputs, training=False)
in_nd = tf.make_ndarray(pred)
print('****: ', in_nd.shape, in_nd.min(), in_nd.max())
t_loss = self.loss(labels, pred) t_loss = self.loss(labels, pred)
self.test_loss(t_loss) self.test_loss(t_loss)
...@@ -780,27 +776,19 @@ def run_evaluate_static(in_file, out_file, ckpt_dir): ...@@ -780,27 +776,19 @@ def run_evaluate_static(in_file, out_file, ckpt_dir):
# grd_c = gaussian_filter(grd_c, sigma=1.0) # grd_c = gaussian_filter(grd_c, sigma=1.0)
grd_c = grd_c[y_0:y_0+sub_y, x_0:x_0+sub_x] grd_c = grd_c[y_0:y_0+sub_y, x_0:x_0+sub_x]
grd_c = grd_c.copy() grd_c = grd_c.copy()
print(grd_c.shape)
grd_c = np.where(np.isnan(grd_c), 0, grd_c) grd_c = np.where(np.isnan(grd_c), 0, grd_c)
hr_grd_c = grd_c.copy() hr_grd_c = grd_c.copy()
hr_grd_c = hr_grd_c[y_128, x_128] hr_grd_c = hr_grd_c[y_128, x_128]
print(hr_grd_c.shape)
grd_c = grd_c[slc_y_2, slc_x_2] grd_c = grd_c[slc_y_2, slc_x_2]
print(grd_c.shape)
grd_c = resample_2d_linear_one(x_2, y_2, grd_c, t, s) grd_c = resample_2d_linear_one(x_2, y_2, grd_c, t, s)
print(grd_c.shape)
grd_c = grd_c[y_k, x_k] grd_c = grd_c[y_k, x_k]
print(grd_c.shape)
if label_param != 'cloud_probability': if label_param != 'cloud_probability':
grd_c = normalize(grd_c, label_param, mean_std_dct) grd_c = normalize(grd_c, label_param, mean_std_dct)
print(grd_c.shape)
# data = np.stack([grd_a, grd_b, grd_c], axis=2) # data = np.stack([grd_a, grd_b, grd_c], axis=2)
#data = np.stack([grd_a, grd_c], axis=2) #data = np.stack([grd_a, grd_c], axis=2)
data = np.stack([grd_c], axis=2) data = np.stack([grd_c], axis=2)
print(data.shape)
data = np.expand_dims(data, axis=0) data = np.expand_dims(data, axis=0)
print(data.shape)
nn = SRCNN() nn = SRCNN()
out_sr = nn.run_evaluate(data, ckpt_dir) out_sr = nn.run_evaluate(data, ckpt_dir)
......
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