diff --git a/modules/deeplearning/icing_fcn.py b/modules/deeplearning/icing_fcn.py index e673ca3018fc9722c35647570a4e64932dd0bbf9..acc119b684a32c63028ff66307bfa1584eb10aa8 100644 --- a/modules/deeplearning/icing_fcn.py +++ b/modules/deeplearning/icing_fcn.py @@ -572,7 +572,7 @@ class IcingIntensityFCN: def setup_eval_pipeline(self, data_dct, num_tiles=1): self.data_dct = data_dct - self.cth_max = data_dct.get('cth_high_avg', None) + # self.cth_max = data_dct.get('cth_high_avg', None) idxs = np.arange(num_tiles) self.num_data_samples = idxs.shape[0] @@ -1160,9 +1160,12 @@ def run_evaluate_static(data_dct, num_tiles, ckpt_dir_s_path, day_night='DAY', l def run_evaluate_static_2(model, data_dct, num_tiles, prob_thresh=0.5, flight_levels=[0, 1, 2, 3, 4], use_flight_altitude=False, use_max_cth_level=False): - if not use_flight_altitude or use_max_cth_level: + if not use_flight_altitude: flight_levels = [0] + if use_max_cth_level: + flight_levels.append(5) + probs_dct = {flvl: None for flvl in flight_levels} preds_dct = {flvl: None for flvl in flight_levels} @@ -1174,6 +1177,18 @@ def run_evaluate_static_2(model, data_dct, num_tiles, prob_thresh=0.5, flight_le probs_dct[flvl] = model.test_probs.flatten() preds_dct[flvl] = model.test_preds.flatten() + if use_max_cth_level: + flvl = 5 + model.cth_max = data_dct.get('cth_high_avg', None) + model.flight_level = flvl + model.setup_eval_pipeline(data_dct, num_tiles) + model.do_evaluate(prob_thresh=prob_thresh) + + probs_dct[flvl] = model.test_probs.flatten() + preds_dct[flvl] = model.test_preds.flatten() + + + return preds_dct, probs_dct