fix: flask preview line height should scale with zoom

This commit is contained in:
jh 2021-03-11 23:51:24 -08:00
commit 2a55ecb42d
2 changed files with 3 additions and 6 deletions

View file

@ -308,9 +308,7 @@ def create_preview_pane_image(previews, selected_preview, loss_history,
else:
loss_history_to_show = loss_history[-show_last_history_iters_count:]
lh_height = int(100 * zoom.scale)
# FIXME: investigate old behavior (batch_size, lh_height)
# lh_img = models.ModelBase.get_loss_history_preview(loss_history_to_show, iteration, batch_size, w, c, lh_height)
lh_img = models.ModelBase.get_loss_history_preview(loss_history_to_show, iteration, w, c)
lh_img = models.ModelBase.get_loss_history_preview(loss_history_to_show, iteration, w, c, lh_height)
final = np.concatenate([final, lh_img], axis=0)
final = np.concatenate([final, selected_preview_rgb], axis=0)

View file

@ -574,10 +574,9 @@ class ModelBase(object):
return summary_text
@staticmethod
def get_loss_history_preview(loss_history, iter, w, c):
def get_loss_history_preview(loss_history, iter, w, c, lh_height=100):
loss_history = np.array (loss_history.copy())
lh_height = 100
lh_img = np.ones ( (lh_height,w,c) ) * 0.1
if len(loss_history) != 0: