SAE: new options face_style_power, bg_style_power instead of style_power. Zero - means dont use style.

SAE: new option 'lighter_encoder'.
Now model settings can be overrided by pressing enter in 2 seconds while model loading (works on Windows).
Removed all MultiGPU models, because keras multi_gpu in fact doesn't work.
This commit is contained in:
iperov 2019-01-10 18:28:12 +04:00
parent c3f175862a
commit 48d0123f0b
9 changed files with 158 additions and 139 deletions

View file

@ -1,4 +1,7 @@
import os
import sys
import time
import multiprocessing
def input_int(s, default_value, valid_list=None, help_message=None):
while True:
@ -51,4 +54,28 @@ def input_str(s, default_value, valid_list=None, help_message=None):
return inp
except:
print (default_value)
return default_value
return default_value
def input_process(stdin_fd, sq, str):
sys.stdin = os.fdopen(stdin_fd)
try:
inp = input (str)
sq.put (True)
except:
sq.put (False)
def input_in_time (str, max_time_sec):
sq = multiprocessing.Queue()
p = multiprocessing.Process(target=input_process, args=( sys.stdin.fileno(), sq, str))
p.start()
t = time.time()
inp = False
while True:
if not sq.empty():
inp = sq.get()
break
if time.time() - t > max_time_sec:
break
p.terminate()
sys.stdin = os.fdopen( sys.stdin.fileno() )
return inp