Skip to content

Commit

Permalink
fix(api): variable name in GFPGAN
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Jan 31, 2023
1 parent 39f84c4 commit 1ca7edb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/onnx_web/chain/correct_gfpgan.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ def correct_gfpgan(
) -> Image.Image:
if upscale.correction_model is None:
logger.warn('no face model given, skipping')
return image
return source_image

logger.info('correcting faces with GFPGAN model: %s', upscale.correction_model)
gfpgan = load_gfpgan(ctx, upscale, upsampler=upsampler)

output = np.array(source_image)
_, _, output = gfpgan.enhance(
image, has_aligned=False, only_center_face=False, paste_back=True, weight=upscale.face_strength)
source_image, has_aligned=False, only_center_face=False, paste_back=True, weight=upscale.face_strength)
output = Image.fromarray(output, 'RGB')

return output

0 comments on commit 1ca7edb

Please sign in to comment.