Fix preview (#499)

This commit is contained in:
K1llMan 2023-06-15 20:58:54 +03:00 committed by GitHub
parent a2b26dc966
commit d3f38c7524
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -199,11 +199,11 @@ def init_preview() -> None:
def update_preview(frame_number: int = 0) -> None:
if roop.globals.source_path and roop.globals.target_path:
video_frame = None
video_frame = get_video_frame(roop.globals.target_path, frame_number)
for frame_processor in get_frame_processors_modules(roop.globals.frame_processors):
video_frame = frame_processor.process_frame(
get_one_face(cv2.imread(roop.globals.source_path)),
get_video_frame(roop.globals.target_path, frame_number)
video_frame
)
image = Image.fromarray(cv2.cvtColor(video_frame, cv2.COLOR_BGR2RGB))
image = ImageOps.contain(image, (PREVIEW_MAX_WIDTH, PREVIEW_MAX_HEIGHT), Image.LANCZOS)