Skip to content
Permalink
Browse files

fix of converter when using relighted faces in dst

  • Loading branch information
iperov committed Nov 12, 2019
1 parent 4868bd1 commit 2167c5cbcba9482c633351cfc7c65a6ea73bb9e6
Showing with 16 additions and 2 deletions.
  1. +7 −1 mainscripts/Converter.py
  2. +3 −1 mainscripts/FacesetRelighter.py
  3. +3 −0 utils/DFLJPG.py
  4. +3 −0 utils/DFLPNG.py
@@ -687,7 +687,13 @@ def main (args, device_args):
io.log_err ("%s is not a dfl image file" % (filepath.name) )
continue

source_filename_stem = Path( dflimg.get_source_filename() ).stem
source_filename = dflimg.get_source_filename()
if source_filename is None or source_filename == "_":
continue

source_filename = Path(source_filename)
source_filename_stem = source_filename.stem

if source_filename_stem not in alignments.keys():
alignments[ source_filename_stem ] = []

@@ -235,7 +235,9 @@ def relight(input_dir, lighten=None, random_one=None):
i += 1

cv2_imwrite (relighted_filepath, relighted_img )
dflimg.embed_and_set (relighted_filepath, source_filename="_", relighted=True )

dflimg.remove_source_filename()
dflimg.embed_and_set (relighted_filepath, relighted=True )
except:
io.log_err (f"Exception occured while processing file {filepath.name}. Error: {traceback.format_exc()}")

@@ -246,6 +246,9 @@ def remove_ie_polys(self):

def remove_fanseg_mask(self):
self.dfl_dict['fanseg_mask'] = None

def remove_source_filename(self):
self.dfl_dict['source_filename'] = None

def dump(self):
data = b""
@@ -364,6 +364,9 @@ def remove_ie_polys(self):

def remove_fanseg_mask(self):
self.dfl_dict['fanseg_mask'] = None

def remove_source_filename(self):
self.dfl_dict['source_filename'] = None

def dump(self):
data = PNG_HEADER

0 comments on commit 2167c5c

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