make generate mask from RemoveBG && AnimeSeg work
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import cv2
|
||||
import numpy as np
|
||||
from loguru import logger
|
||||
|
||||
from lama_cleaner.helper import download_model
|
||||
@@ -8,6 +9,7 @@ from lama_cleaner.schema import RunPluginRequest
|
||||
|
||||
class GFPGANPlugin(BasePlugin):
|
||||
name = "GFPGAN"
|
||||
support_gen_image = True
|
||||
|
||||
def __init__(self, device, upscaler=None):
|
||||
super().__init__()
|
||||
@@ -37,7 +39,7 @@ class GFPGANPlugin(BasePlugin):
|
||||
self.face_enhancer.face_helper.face_det.to(device)
|
||||
)
|
||||
|
||||
def __call__(self, rgb_np_img, req: RunPluginRequest):
|
||||
def gen_image(self, rgb_np_img, req: RunPluginRequest) -> np.ndarray:
|
||||
weight = 0.5
|
||||
bgr_np_img = cv2.cvtColor(rgb_np_img, cv2.COLOR_RGB2BGR)
|
||||
logger.info(f"GFPGAN input shape: {bgr_np_img.shape}")
|
||||
|
||||
Reference in New Issue
Block a user