Skip to content

Commit

Permalink
fix extract
Browse files Browse the repository at this point in the history
  • Loading branch information
glucauze committed Aug 3, 2023
1 parent be1cd15 commit 26ac286
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions client_api/faceswaplab_api_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

address = "http://127.0.0.1:7860"

# This has been tested on Linux platforms. This might requires some minor adaptations for windows.


#############################
# FaceSwap
Expand Down
1 change: 1 addition & 0 deletions scripts/faceswaplab_swapping/upscaled_inswapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ def compute_diff(bgr_fake: CV2ImgU8, aimg: CV2ImgU8) -> CV2ImgU8:
)

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)

Expand Down
4 changes: 3 additions & 1 deletion scripts/faceswaplab_ui/faceswaplab_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 26ac286

Please sign in to comment.