Skip to content

Commit

Permalink
fix(api): resolve face correction model relative to model path
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Jan 16, 2023
1 parent 1d90f9b commit 5a01fe4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 0 additions & 1 deletion api/onnx_web/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@
upscale_models = [
'RealESRGAN_x4plus',
'GFPGANv1.3',
# TODO: convert GFPGAN
# 'https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.3.pth',
]

Expand Down
4 changes: 3 additions & 1 deletion api/onnx_web/upscale.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,10 @@ def upscale_gfpgan(ctx: ServerContext, params: UpscaleParams, image, upsampler=N
if upsampler is None:
upsampler = make_resrgan(ctx, params, tile=512)

face_path = path.join(ctx.model_path, '%s.pth' % (params.face_model)) # TODO: convert to ONNX

face_enhancer = GFPGANer(
model_path=params.face_model,
model_path=face_path,
upscale=params.outscale,
arch='clean',
channel_multiplier=2,
Expand Down

0 comments on commit 5a01fe4

Please sign in to comment.