fix(api): resolve face correction model relative to model path
This commit is contained in:
parent
1d90f9b53c
commit
5a01fe4cb0
|
@ -99,7 +99,6 @@ mask_filters = {
|
||||||
upscale_models = [
|
upscale_models = [
|
||||||
'RealESRGAN_x4plus',
|
'RealESRGAN_x4plus',
|
||||||
'GFPGANv1.3',
|
'GFPGANv1.3',
|
||||||
# TODO: convert GFPGAN
|
|
||||||
# 'https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.3.pth',
|
# 'https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.3.pth',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -167,8 +167,10 @@ def upscale_gfpgan(ctx: ServerContext, params: UpscaleParams, image, upsampler=N
|
||||||
if upsampler is None:
|
if upsampler is None:
|
||||||
upsampler = make_resrgan(ctx, params, tile=512)
|
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(
|
face_enhancer = GFPGANer(
|
||||||
model_path=params.face_model,
|
model_path=face_path,
|
||||||
upscale=params.outscale,
|
upscale=params.outscale,
|
||||||
arch='clean',
|
arch='clean',
|
||||||
channel_multiplier=2,
|
channel_multiplier=2,
|
||||||
|
|
Loading…
Reference in New Issue