refactorings

This commit is contained in:
iperov 2019-04-24 11:28:58 +04:00
parent e1da9c56b4
commit 947feac047
11 changed files with 254 additions and 215 deletions

View file

@ -44,20 +44,20 @@ class Model(ModelBase):
self.convert = K.function([ae_input_layer], rec_src)
if self.is_training_mode:
f = SampleProcessor.TypeFlags
t = SampleProcessor.Types
output_sample_types=[ { 'types': (t.IMG_WARPED_TRANSFORMED, t.FACE_TYPE_FULL, t.MODE_BGR), 'resolution':128},
{ 'types': (t.IMG_TRANSFORMED, t.FACE_TYPE_FULL, t.MODE_BGR), 'resolution':128},
{ 'types': (t.IMG_TRANSFORMED, t.FACE_TYPE_FULL, t.MODE_M, t.FACE_MASK_FULL), 'resolution':128} ]
self.set_training_data_generators ([
SampleGeneratorFace(self.training_data_src_path, sort_by_yaw_target_samples_path=self.training_data_dst_path if self.sort_by_yaw else None,
debug=self.is_debug(), batch_size=self.batch_size,
sample_process_options=SampleProcessor.Options(random_flip=self.random_flip, scale_range=np.array([-0.05, 0.05])+self.src_scale_mod / 100.0 ),
output_sample_types=[ [f.WARPED_TRANSFORMED | f.FACE_TYPE_FULL | f.MODE_BGR, 128],
[f.TRANSFORMED | f.FACE_TYPE_FULL | f.MODE_BGR, 128],
[f.TRANSFORMED | f.FACE_TYPE_FULL | f.MODE_M | f.FACE_MASK_FULL, 128] ] ),
output_sample_types=output_sample_types),
SampleGeneratorFace(self.training_data_dst_path, debug=self.is_debug(), batch_size=self.batch_size,
sample_process_options=SampleProcessor.Options(random_flip=self.random_flip),
output_sample_types=[ [f.WARPED_TRANSFORMED | f.FACE_TYPE_FULL | f.MODE_BGR, 128],
[f.TRANSFORMED | f.FACE_TYPE_FULL | f.MODE_BGR, 128],
[f.TRANSFORMED | f.FACE_TYPE_FULL | f.MODE_M | f.FACE_MASK_FULL, 128] ] )
output_sample_types=output_sample_types)
])
#override
def onSave(self):