extractior: fix extract from already extracted dflimg
This commit is contained in:
@@ -214,6 +214,10 @@ class ExtractSubprocessor(Subprocessor):
|
|||||||
else:
|
else:
|
||||||
face_idx = 0
|
face_idx = 0
|
||||||
for rect, image_landmarks in zip( rects, landmarks ):
|
for rect, image_landmarks in zip( rects, landmarks ):
|
||||||
|
if src_dflimg is not None and face_idx > 1:
|
||||||
|
#cannot extract more than 1 face from dflimg
|
||||||
|
break
|
||||||
|
|
||||||
if image_landmarks is None:
|
if image_landmarks is None:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
@@ -238,8 +242,8 @@ class ExtractSubprocessor(Subprocessor):
|
|||||||
if self.debug_dir is not None:
|
if self.debug_dir is not None:
|
||||||
LandmarksProcessor.draw_rect_landmarks (debug_image, rect, image_landmarks, self.image_size, self.face_type, transparent_mask=True)
|
LandmarksProcessor.draw_rect_landmarks (debug_image, rect, image_landmarks, self.image_size, self.face_type, transparent_mask=True)
|
||||||
|
|
||||||
if src_dflimg is not None:
|
if src_dflimg is not None and filename_path.suffix == '.jpg':
|
||||||
#if extracting from dflimg copy it in order not to lose quality
|
#if extracting from dflimg and jpg copy it in order not to lose quality
|
||||||
output_file = str(self.final_output_path / filename_path.name)
|
output_file = str(self.final_output_path / filename_path.name)
|
||||||
if str(filename_path) != str(output_file):
|
if str(filename_path) != str(output_file):
|
||||||
shutil.copy ( str(filename_path), str(output_file) )
|
shutil.copy ( str(filename_path), str(output_file) )
|
||||||
|
|||||||
Reference in New Issue
Block a user