fix extract
This commit is contained in:
@@ -18,6 +18,8 @@ from api_utils import (
|
||||
|
||||
address = "http://127.0.0.1:7860"
|
||||
|
||||
# This has been tested on Linux platforms. This might requires some minor adaptations for windows.
|
||||
|
||||
|
||||
#############################
|
||||
# FaceSwap
|
||||
|
||||
@@ -210,6 +210,7 @@ class UpscaledINSwapper(INSwapper):
|
||||
)
|
||||
|
||||
if options.improved_mask:
|
||||
logger.info("improved_mask")
|
||||
mask = get_face_mask(aimg, bgr_fake)
|
||||
bgr_fake = merge_images_with_mask(aimg, bgr_fake, mask)
|
||||
|
||||
|
||||
@@ -70,7 +70,9 @@ def extract_faces(
|
||||
logger.error("You need at least one image file to extract")
|
||||
return []
|
||||
try:
|
||||
postprocess_options = PostProcessingOptions(*components) # type: ignore
|
||||
postprocess_options = dataclasses_from_flat_list(
|
||||
[PostProcessingOptions], components
|
||||
).pop()
|
||||
images = [
|
||||
Image.open(file.name) for file in files
|
||||
] # potentially greedy but Image.open is supposed to be lazy
|
||||
|
||||
Reference in New Issue
Block a user