Skip to content

Commit

Permalink
fix(api): remove background upscaler from GFPGAN stage (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Feb 6, 2023
1 parent 1f65da8 commit 24ab52b
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions api/onnx_web/chain/correct_gfpgan.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,11 @@


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:
Expand All @@ -43,7 +39,6 @@ def load_gfpgan(
upscale=upscale.outscale,
arch="clean",
channel_multiplier=2,
bg_upsampler=upsampler,
)

last_pipeline_instance = gfpgan
Expand Down

0 comments on commit 24ab52b

Please sign in to comment.