mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-14 17:13:42 -07:00
Long startup time on Linux (#356)
This commit is contained in:
parent
e7562054d0
commit
a33ef50da5
1 changed files with 8 additions and 4 deletions
|
@ -12,7 +12,7 @@ import cv2
|
|||
import models
|
||||
from interact import interact as io
|
||||
|
||||
def trainerThread (s2c, c2s, args, device_args):
|
||||
def trainerThread (s2c, c2s, e, args, device_args):
|
||||
while True:
|
||||
try:
|
||||
start_time = time.time()
|
||||
|
@ -66,6 +66,7 @@ def trainerThread (s2c, c2s, args, device_args):
|
|||
else:
|
||||
previews = [( 'debug, press update for new', model.debug_one_iter())]
|
||||
c2s.put ( {'op':'show', 'previews': previews} )
|
||||
e.set() #Set the GUI Thread as Ready
|
||||
|
||||
|
||||
if model.is_first_run():
|
||||
|
@ -189,9 +190,12 @@ def main(args, device_args):
|
|||
s2c = queue.Queue()
|
||||
c2s = queue.Queue()
|
||||
|
||||
thread = threading.Thread(target=trainerThread, args=(s2c, c2s, args, device_args) )
|
||||
e = threading.Event()
|
||||
thread = threading.Thread(target=trainerThread, args=(s2c, c2s, e, args, device_args) )
|
||||
thread.start()
|
||||
|
||||
e.wait() #Wait for inital load to occur.
|
||||
|
||||
if no_preview:
|
||||
while True:
|
||||
if not c2s.empty():
|
||||
|
@ -291,7 +295,7 @@ def main(args, device_args):
|
|||
|
||||
key_events = io.get_key_events(wnd_name)
|
||||
key, chr_key, ctrl_pressed, alt_pressed, shift_pressed = key_events[-1] if len(key_events) > 0 else (0,0,False,False,False)
|
||||
|
||||
|
||||
if key == ord('\n') or key == ord('\r'):
|
||||
s2c.put ( {'op': 'close'} )
|
||||
elif key == ord('s'):
|
||||
|
@ -321,4 +325,4 @@ def main(args, device_args):
|
|||
except KeyboardInterrupt:
|
||||
s2c.put ( {'op': 'close'} )
|
||||
|
||||
io.destroy_all_windows()
|
||||
io.destroy_all_windows()
|
Loading…
Add table
Add a link
Reference in a new issue