mirror of
https://github.com/sbrl/research-rainfallradar
synced 2024-11-22 01:12:59 +00:00
dlr/predict: let's try another way
This commit is contained in:
parent
e7c0328648
commit
e1666026ad
1 changed files with 3 additions and 5 deletions
|
@ -246,14 +246,12 @@ def get_overlay(image, coloured_mask):
|
||||||
|
|
||||||
|
|
||||||
def plot_samples_matplotlib(filepath, display_list, figsize=(5, 3)):
|
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)):
|
for i in range(len(display_list)):
|
||||||
|
plt.subplot(nrows=1, ncols=len(display_list), index=i)
|
||||||
if display_list[i].shape[-1] == 3:
|
if display_list[i].shape[-1] == 3:
|
||||||
axes[i].imshow(tf.keras.preprocessing.image.array_to_img(display_list[i]))
|
plt.imshow(tf.keras.preprocessing.image.array_to_img(display_list[i]))
|
||||||
else:
|
else:
|
||||||
axes[i].imshow(display_list[i])
|
plt.imshow(display_list[i])
|
||||||
plt.savefig(filepath)
|
plt.savefig(filepath)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue