From cafa8d941b838363ada25dea231fc38570a734f3 Mon Sep 17 00:00:00 2001 From: tomrink <rink@ssec.wisc.edu> Date: Mon, 16 May 2022 14:01:24 -0500 Subject: [PATCH] snapshot... --- modules/deeplearning/unet.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/deeplearning/unet.py b/modules/deeplearning/unet.py index efe15ca3..16e44f6f 100644 --- a/modules/deeplearning/unet.py +++ b/modules/deeplearning/unet.py @@ -286,7 +286,7 @@ class UNET: def get_in_mem_data_batch(self, idxs, is_training): if is_training: train_data = [] - label_data = [] + train_label = [] for k in idxs: f = self.train_data_files[k] nda = np.load(f) @@ -294,35 +294,35 @@ class UNET: f = self.train_label_files[k] nda = np.load(f) - label_data.append(nda) + train_label.append(nda) data = np.concatenate(train_data) data = np.expand_dims(data, axis=3) - label = np.concatenate(label_data) + label = np.concatenate(train_label) label = np.expand_dims(label, axis=3) else: - train_data = [] - label_data = [] + test_data = [] + test_label = [] for k in idxs: f = self.test_data_files[k] nda = np.load(f) - train_data.append(nda) + test_data.append(nda) f = self.test_label_files[k] nda = np.load(f) - label_data.append(nda) + test_label.append(nda) - data = np.concatenate(train_data) + data = np.concatenate(test_data) data = np.expand_dims(data, axis=3) - label = np.concatenate(label_data) + label = np.concatenate(test_label) label = np.expand_dims(label, axis=3) data = data.astype(np.float32) label = label.astype(np.float32) - normalize(data, 'M15', mean_std_dct) - normalize(label, 'M15', mean_std_dct) + data = normalize(data, 'M15', mean_std_dct) + label = normalize(label, 'M15', mean_std_dct) if is_training and DO_AUGMENT: data_ud = np.flip(data, axis=1) -- GitLab