1
0
Fork 0

fix(api): separate Real ESRGAN upsampler from GFPGAN stage (#87)

This commit is contained in:
Sean Sube 2023-02-12 13:50:28 -06:00
parent ae8aa2ea7a
commit 82487f5771
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
1 changed files with 1 additions and 4 deletions

View File

@ -9,7 +9,6 @@ from PIL import Image
from ..device_pool import JobContext from ..device_pool import JobContext
from ..params import DeviceParams, ImageParams, StageParams, UpscaleParams from ..params import DeviceParams, ImageParams, StageParams, UpscaleParams
from ..utils import ServerContext, run_gc from ..utils import ServerContext, run_gc
from .upscale_resrgan import load_resrgan
logger = getLogger(__name__) logger = getLogger(__name__)
@ -35,12 +34,10 @@ def load_gfpgan(
logger.debug("loading GFPGAN model from %s", face_path) logger.debug("loading GFPGAN model from %s", face_path)
upsampler = load_resrgan(server, upscale, device, tile=stage.tile_size)
# TODO: find a way to pass the ONNX model to underlying architectures # TODO: find a way to pass the ONNX model to underlying architectures
gfpgan = GFPGANer( gfpgan = GFPGANer(
arch="clean", arch="clean",
bg_upsampler=upsampler, bg_upsampler=None,
channel_multiplier=2, channel_multiplier=2,
model_path=face_path, model_path=face_path,
upscale=upscale.face_outscale, upscale=upscale.face_outscale,