dlr: make size fo prediction graph actually sensible

This commit is contained in:
Starbeamrainbowlabs 2023-03-09 19:54:27 +00:00
parent 8d932757b5
commit d24381babb
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -4,10 +4,12 @@
from datetime import datetime from datetime import datetime
from loguru import logger from loguru import logger
from lib.ai.helpers.summarywriter import summarywriter from lib.ai.helpers.summarywriter import summarywriter
from lib.ai.components.CallbackCustomModelCheckpoint import CallbackCustomModelCheckpoint from lib.ai.components.CallbackCustomModelCheckpoint import CallbackCustomModelCheckpoint
import os import os
import math
import cv2 import cv2
import numpy as np import numpy as np
from glob import glob from glob import glob
@ -293,8 +295,9 @@ def get_overlay(image, coloured_mask):
def plot_samples_matplotlib(filepath, display_list): def plot_samples_matplotlib(filepath, display_list):
plt.figure(figsize=(16, 8))
for i in range(len(display_list)): for i in range(len(display_list)):
plt.subplot(1, len(display_list), i+1) plt.subplot(2, math.ceil(len(display_list) / 2), i+1)
if display_list[i].shape[-1] == 3: if display_list[i].shape[-1] == 3:
plt.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: