Skip to content

Commit

Permalink
fix case when no face is detected in source
Browse files Browse the repository at this point in the history
  • Loading branch information
kex0 committed Jul 1, 2023
1 parent c31adf5 commit ed8b334
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions roop/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,6 @@ def create_filename(source_index, target_index):


def start() -> None:
for frame_processor in get_frame_processors_modules(roop.globals.frame_processors):
if not frame_processor.pre_start():
return

# make sure roop.globals.target_paths and roop.globals.source_paths are lists
if isinstance(roop.globals.target_paths, str):
roop.globals.target_paths = [roop.globals.target_paths]
Expand Down Expand Up @@ -209,6 +205,15 @@ def start() -> None:
ui.source_label.configure(image=image)
output_path = roop.globals.output_path

# check if a face in the source image is detected
source_face = True
for frame_processor in get_frame_processors_modules(roop.globals.frame_processors):
if not frame_processor.pre_start():
source_face = False
break
if not source_face:
continue

# create the output filename
output_name = create_filename(source_index, target_index)

Expand Down

0 comments on commit ed8b334

Please sign in to comment.