mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-11 07:37:03 -07:00
trainer preview: added [l]: change history range
This commit is contained in:
parent
75eb7468ee
commit
72c7db4980
1 changed files with 21 additions and 4 deletions
|
@ -126,6 +126,7 @@ def previewThread (input_queue, output_queue):
|
||||||
update_preview = False
|
update_preview = False
|
||||||
is_showing = False
|
is_showing = False
|
||||||
is_waiting_preview = False
|
is_waiting_preview = False
|
||||||
|
show_last_history_epochs_count = 0
|
||||||
epoch = 0
|
epoch = 0
|
||||||
while True:
|
while True:
|
||||||
if not input_queue.empty():
|
if not input_queue.empty():
|
||||||
|
@ -171,7 +172,7 @@ def previewThread (input_queue, output_queue):
|
||||||
# HEAD
|
# HEAD
|
||||||
head_lines = [
|
head_lines = [
|
||||||
'[s]:save [enter]:exit',
|
'[s]:save [enter]:exit',
|
||||||
'[p]:update [space]:next preview',
|
'[p]:update [space]:next preview [l]:change history range',
|
||||||
'Preview: "%s" [%d/%d]' % (selected_preview_name,selected_preview+1, len(previews) )
|
'Preview: "%s" [%d/%d]' % (selected_preview_name,selected_preview+1, len(previews) )
|
||||||
]
|
]
|
||||||
head_line_height = 15
|
head_line_height = 15
|
||||||
|
@ -185,9 +186,13 @@ def previewThread (input_queue, output_queue):
|
||||||
|
|
||||||
final = head
|
final = head
|
||||||
|
|
||||||
if loss_history is not None:
|
if loss_history is not None:
|
||||||
# LOSS HISTORY
|
if show_last_history_epochs_count == 0:
|
||||||
lh_img = models.ModelBase.get_loss_history_preview(loss_history, epoch, w, c)
|
loss_history_to_show = loss_history
|
||||||
|
else:
|
||||||
|
loss_history_to_show = loss_history[-show_last_history_epochs_count:]
|
||||||
|
|
||||||
|
lh_img = models.ModelBase.get_loss_history_preview(loss_history_to_show, epoch, 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 )
|
||||||
|
@ -210,6 +215,18 @@ def previewThread (input_queue, output_queue):
|
||||||
if not is_waiting_preview:
|
if not is_waiting_preview:
|
||||||
is_waiting_preview = True
|
is_waiting_preview = True
|
||||||
output_queue.put ( {'op': 'preview'} )
|
output_queue.put ( {'op': 'preview'} )
|
||||||
|
elif key == ord('l'):
|
||||||
|
if show_last_history_epochs_count == 0:
|
||||||
|
show_last_history_epochs_count = 5000
|
||||||
|
elif show_last_history_epochs_count == 5000:
|
||||||
|
show_last_history_epochs_count = 10000
|
||||||
|
elif show_last_history_epochs_count == 10000:
|
||||||
|
show_last_history_epochs_count = 50000
|
||||||
|
elif show_last_history_epochs_count == 50000:
|
||||||
|
show_last_history_epochs_count = 100000
|
||||||
|
elif show_last_history_epochs_count == 100000:
|
||||||
|
show_last_history_epochs_count = 0
|
||||||
|
update_preview = True
|
||||||
elif key == ord(' '):
|
elif key == ord(' '):
|
||||||
selected_preview = (selected_preview + 1) % len(previews)
|
selected_preview = (selected_preview + 1) % len(previews)
|
||||||
update_preview = True
|
update_preview = True
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue