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: else:
loss_history_to_show = loss_history[-show_last_history_iters_count:] loss_history_to_show = loss_history[-show_last_history_iters_count:]
lh_height = int(100 * zoom.scale) 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, w, c, 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)
final = np.concatenate([final, lh_img], axis=0) final = np.concatenate([final, lh_img], axis=0)
final = np.concatenate([final, selected_preview_rgb], axis=0) final = np.concatenate([final, selected_preview_rgb], axis=0)

View file

@ -535,7 +535,7 @@ class ModelBase(object):
def get_summary_text(self): def get_summary_text(self):
visible_options = self.options.copy() visible_options = self.options.copy()
visible_options.update(self.options_show_override) visible_options.update(self.options_show_override)
###Generate text summary of model hyperparameters ###Generate text summary of model hyperparameters
#Find the longest key name and value string. Used as column widths. #Find the longest key name and value string. Used as column widths.
width_name = max([len(k) for k in visible_options.keys()] + [17]) + 1 # Single space buffer to left edge. Minimum of 17, the length of the longest static string used "Current iteration" width_name = max([len(k) for k in visible_options.keys()] + [17]) + 1 # Single space buffer to left edge. Minimum of 17, the length of the longest static string used "Current iteration"
@ -574,10 +574,9 @@ class ModelBase(object):
return summary_text return summary_text
@staticmethod @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()) loss_history = np.array (loss_history.copy())
lh_height = 100
lh_img = np.ones ( (lh_height,w,c) ) * 0.1 lh_img = np.ones ( (lh_height,w,c) ) * 0.1
if len(loss_history) != 0: if len(loss_history) != 0: