diff --git a/DFLIMG/DFLJPG.py b/DFLIMG/DFLJPG.py index 10f0c21..2d2ba56 100644 --- a/DFLIMG/DFLJPG.py +++ b/DFLIMG/DFLJPG.py @@ -196,10 +196,14 @@ class DFLJPG(object): else: io.log_err("Unable to encode fanseg_mask for %s" % (filename) ) fanseg_mask = None + + if ie_polys is not None: + if not isinstance(ie_polys, list): + ie_polys = ie_polys.dump() DFLJPG.embed_dfldict (filename, {'face_type': face_type, 'landmarks': landmarks, - 'ie_polys' : ie_polys.dump() if ie_polys is not None else None, + 'ie_polys' : ie_polys, 'source_filename': source_filename, 'source_rect': source_rect, 'source_landmarks': source_landmarks, diff --git a/DFLIMG/DFLPNG.py b/DFLIMG/DFLPNG.py index d50a489..38c90ee 100644 --- a/DFLIMG/DFLPNG.py +++ b/DFLIMG/DFLPNG.py @@ -312,10 +312,14 @@ class DFLPNG(object): else: io.log_err("Unable to encode fanseg_mask for %s" % (filename) ) fanseg_mask = None - + + if ie_polys is not None: + if not isinstance(ie_polys, list): + ie_polys = ie_polys.dump() + DFLPNG.embed_dfldict (filename, {'face_type': face_type, 'landmarks': landmarks, - 'ie_polys' : ie_polys.dump() if ie_polys is not None else None, + 'ie_polys' : ie_polys, 'source_filename': source_filename, 'source_rect': source_rect, 'source_landmarks': source_landmarks,