From be7dd91f88da44f8cd7761b2d7194ceaaa0d7b05 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Wed, 11 Jan 2023 17:41:55 +0000 Subject: [PATCH] fix crash 'cause we're only plotting 1 thing --- aimodel/src/deeplabv3_plus_test_rainfall.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aimodel/src/deeplabv3_plus_test_rainfall.py b/aimodel/src/deeplabv3_plus_test_rainfall.py index c247154..1be2807 100755 --- a/aimodel/src/deeplabv3_plus_test_rainfall.py +++ b/aimodel/src/deeplabv3_plus_test_rainfall.py @@ -247,6 +247,8 @@ def get_overlay(image, coloured_mask): def plot_samples_matplotlib(filepath, display_list, figsize=(5, 3)): _, axes = plt.subplots(nrows=1, ncols=len(display_list), figsize=figsize) + if not isinstance(axes, list): + axes = [ axes ] for i in range(len(display_list)): if display_list[i].shape[-1] == 3: axes[i].imshow(tf.keras.preprocessing.image.array_to_img(display_list[i]))