Skip to content
Permalink
Browse files

converter: removed 'ebs' color transfer

  • Loading branch information...
iperov committed Nov 4, 2019
1 parent 71a98e2 commit e65e74ac2da8bf094589850394e2270a179c9900
Showing with 4 additions and 4 deletions.
  1. +1 −1 converters/ConvertMasked.py
  2. +3 −3 converters/ConverterConfig.py
@@ -208,7 +208,7 @@ def ConvertMaskedFace (predictor_func, predictor_input_shape, cfg, frame_info, i
elif cfg.color_transfer_mode == 6: #idt-m
prd_face_bgr = imagelib.color_transfer_idt (prd_face_bgr*prd_face_mask_a, dst_face_bgr*prd_face_mask_a)

elif cfg.color_transfer_mode == 7: #ebs
elif cfg.color_transfer_mode == 7: #ebs, currently unused
prd_face_bgr = cfg.ebs_ct_func ( np.clip( (dst_face_bgr*255), 0, 255).astype(np.uint8),
np.clip( (prd_face_bgr*255), 0, 255).astype(np.uint8), )#prd_face_mask_a
prd_face_bgr = np.clip( prd_face_bgr.astype(np.float32) / 255.0, 0.0, 1.0)
@@ -107,8 +107,8 @@ def to_string(self, filename):
4:'FAN-dst',
7:'learned*FAN-dst'}

ctm_dict = { 0: "None", 1:"rct", 2:"lct", 3:"mkl", 4:"mkl-m", 5:"idt", 6:"idt-m", 7:"ebs" }
ctm_str_dict = {None:0, "rct":1, "lct":2, "mkl":3, "mkl-m":4, "idt":5, "idt-m":6, "ebs":7 }
ctm_dict = { 0: "None", 1:"rct", 2:"lct", 3:"mkl", 4:"mkl-m", 5:"idt", 6:"idt-m" }
ctm_str_dict = {None:0, "rct":1, "lct":2, "mkl":3, "mkl-m":4, "idt":5, "idt-m":6 }

class ConverterConfigMasked(ConverterConfig):

@@ -221,7 +221,7 @@ def ask_settings(self):
self.output_face_scale = np.clip (io.input_int ("Choose output face scale modifier [-50..50] (skip:0) : ", 0), -50, 50)

if 'raw' not in self.mode:
self.color_transfer_mode = io.input_str ("Apply color transfer to predicted face? Choose mode ( rct/lct/ebs skip:None ) : ", None, ctm_str_dict.keys() )
self.color_transfer_mode = io.input_str ( f"Apply color transfer to predicted face? Choose mode ( {' / '.join ([str(x) for x in list(ctm_str_dict.keys())])} skip:None ) : ", None, ctm_str_dict.keys() )
self.color_transfer_mode = ctm_str_dict[self.color_transfer_mode]

super().ask_settings()

0 comments on commit e65e74a

Please sign in to comment.
You can’t perform that action at this time.