mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-07 13:32:09 -07:00
automatized arguments with pickle
This commit is contained in:
parent
afd87df67a
commit
dee168e5a6
3 changed files with 15 additions and 6 deletions
|
@ -229,8 +229,9 @@ class InteractBase(object):
|
||||||
return "\n"
|
return "\n"
|
||||||
|
|
||||||
res = dict(filter(lambda item: s in item[0], self.default_answers.items()))
|
res = dict(filter(lambda item: s in item[0], self.default_answers.items()))
|
||||||
if res in self.default_answers:
|
key = list(res.keys())[0]
|
||||||
return res[1]
|
if key in self.default_answers:
|
||||||
|
return list(res.values())[0]
|
||||||
return input(s)
|
return input(s)
|
||||||
|
|
||||||
def input_number(self, s, default_value, valid_list=None, show_default_value=True, add_info=None, help_message=None):
|
def input_number(self, s, default_value, valid_list=None, show_default_value=True, add_info=None, help_message=None):
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import pickle
|
import pickle
|
||||||
|
|
||||||
dictionary = {
|
dictionary = {
|
||||||
'[png] Output image format ( png/jpg ?:help ) : ' : 'png',
|
|
||||||
' : ' : '0',
|
' : ' : '0',
|
||||||
|
'[png] Output image format ( png/jpg ?:help ) : ' : 'png',
|
||||||
'Override' : '0',
|
'Override' : '0',
|
||||||
' Press enter in 2 seconds to override model settings. ' : '\n',
|
' Press enter in 2 seconds to override model settings. ' : '\n',
|
||||||
'[0] Which GPU indexes to choose? : ' : '0',
|
'[0] Which GPU indexes to choose? : ' : '0',
|
||||||
|
@ -14,7 +14,7 @@ dictionary = {
|
||||||
'[y] Continue extraction? ( y/n ?:help ) : ' : 'True',
|
'[y] Continue extraction? ( y/n ?:help ) : ' : 'True',
|
||||||
'[2] Autobackup every N hour ( 0..24 ?:help ) : ' : '2',
|
'[2] Autobackup every N hour ( 0..24 ?:help ) : ' : '2',
|
||||||
'[n] Write preview history ( y/n ?:help ) : ' : 'False',
|
'[n] Write preview history ( y/n ?:help ) : ' : 'False',
|
||||||
'[83000] Target iteration : ' : '83000',
|
'[83000] Target iteration : ' : '100000',
|
||||||
'[n] Flip SRC faces randomly ( y/n ?:help ) : ' : 'False',
|
'[n] Flip SRC faces randomly ( y/n ?:help ) : ' : 'False',
|
||||||
'[n] Flip DST faces randomly ( y/n ?:help ) : ' : 'False',
|
'[n] Flip DST faces randomly ( y/n ?:help ) : ' : 'False',
|
||||||
'[4] Batch_size ( ?:help ) : ' : '4',
|
'[4] Batch_size ( ?:help ) : ' : '4',
|
||||||
|
@ -49,4 +49,11 @@ dictionary = {
|
||||||
'[16] Bitrate of output file in MB/s : ' : '16',
|
'[16] Bitrate of output file in MB/s : ' : '16',
|
||||||
}
|
}
|
||||||
with open('/home/deepfake/interact_dict.pkl', 'wb') as handle:
|
with open('/home/deepfake/interact_dict.pkl', 'wb') as handle:
|
||||||
pickle.dump(dictionary, handle, protocol=pickle.HIGHEST_PROTOCOL)
|
pickle.dump(dictionary, handle, protocol=4)
|
||||||
|
|
||||||
|
#with open('/home/deepfake/interact_dict.pkl', 'rb') as handle:
|
||||||
|
# d = pickle.load(handle)
|
||||||
|
#s = "Target iteration"
|
||||||
|
#res = dict(filter(lambda item: s in item[0], d.items()))
|
||||||
|
#
|
||||||
|
#print(list(res.values())[0])
|
||||||
|
|
|
@ -163,6 +163,7 @@ def trainerThread (s2c, c2s, e,
|
||||||
model_save()
|
model_save()
|
||||||
is_reached_goal = True
|
is_reached_goal = True
|
||||||
io.log_info ('You can use preview now.')
|
io.log_info ('You can use preview now.')
|
||||||
|
os._exit(1)
|
||||||
|
|
||||||
need_save = False
|
need_save = False
|
||||||
while time.time() - last_save_time >= save_interval_min*60:
|
while time.time() - last_save_time >= save_interval_min*60:
|
||||||
|
@ -357,4 +358,4 @@ def main(**kwargs):
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
s2c.put ( {'op': 'close'} )
|
s2c.put ( {'op': 'close'} )
|
||||||
|
|
||||||
io.destroy_all_windows()
|
io.destroy_all_windows()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue