From 1a5189d9394e7dbb99bb0bd0bc1c39b5a072ea01 Mon Sep 17 00:00:00 2001 From: tomrink <rink@ssec.wisc.edu> Date: Thu, 12 May 2022 14:41:11 -0500 Subject: [PATCH] snapshot... --- modules/deeplearning/unet.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/modules/deeplearning/unet.py b/modules/deeplearning/unet.py index b6230fd9..491f7065 100644 --- a/modules/deeplearning/unet.py +++ b/modules/deeplearning/unet.py @@ -538,6 +538,33 @@ class UNET: print('num test samples: ', tst_idxs.shape[0]) print('setup_pipeline: Done') + def setup_pipeline_files(self, data_files, label_files, perc=0.20): + num_files = len(data_files) + num_test_files = int(num_files * perc) + num_train_files = num_files - num_test_files + + self.train_data_files = data_files[0:num_train_files] + self.train_label_files = label_files[0:num_train_files] + self.test_data_files = data_files[num_train_files:] + self.test_label_files = label_files[num_train_files:] + + trn_idxs = np.arange(num_train_files) + np.random.shuffle(trn_idxs) + tst_idxs = np.arange(num_test_files) + + self.get_train_dataset(trn_idxs) + self.get_test_dataset(tst_idxs) + + self.num_data_samples = num_train_files * 30 # approximately + + print('datetime: ', now) + print('training and test data: ') + print('---------------------------') + print('num train samples: ', self.num_data_samples) + print('BATCH SIZE: ', BATCH_SIZE) + print('num test samples: ', tst_idxs.shape[0]) + print('setup_pipeline: Done') + def setup_test_pipeline(self, filename_l1b, filename_l2, seed=None, shuffle=False): if filename_l1b is not None: -- GitLab