From 24ab52bf0dcb5de20e71aeaf911f9d381f4f38c6 Mon Sep 17 00:00:00 2001 From: Sean Sube Date: Mon, 6 Feb 2023 08:33:29 -0600 Subject: [PATCH] fix(api): remove background upscaler from GFPGAN stage (#108) --- api/onnx_web/chain/correct_gfpgan.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/api/onnx_web/chain/correct_gfpgan.py b/api/onnx_web/chain/correct_gfpgan.py index e25ac21e..70ff74f6 100644 --- a/api/onnx_web/chain/correct_gfpgan.py +++ b/api/onnx_web/chain/correct_gfpgan.py @@ -20,15 +20,11 @@ last_pipeline_params = None def load_gfpgan( - ctx: ServerContext, upscale: UpscaleParams, device: DeviceParams, upsampler: Optional[RealESRGANer] = None + ctx: ServerContext, upscale: UpscaleParams, _device: DeviceParams ): global last_pipeline_instance global last_pipeline_params - if upsampler is None: - bg_upscale = upscale.rescale(upscale.outscale) - upsampler = load_resrgan(ctx, bg_upscale, device) - face_path = path.join(ctx.model_path, "%s.pth" % (upscale.correction_model)) if last_pipeline_instance is not None and face_path == last_pipeline_params: @@ -43,7 +39,6 @@ def load_gfpgan( upscale=upscale.outscale, arch="clean", channel_multiplier=2, - bg_upsampler=upsampler, ) last_pipeline_instance = gfpgan