This commit is contained in:
Qing 2023-03-31 22:25:16 +08:00
parent c3cbf8d4a2
commit 5fd253b07e

View File

@ -21,7 +21,7 @@ class GFPGANPlugin(BasePlugin):
import facexlib
if hasattr(facexlib.detection.retinaface, "device"):
facexlib.detection.retinaface.device = device
facexlib.detection.retinaface.device = face_det_device
# Use GFPGAN for face enhancement
self.face_enhancer = MyGFPGANer(
@ -32,9 +32,9 @@ class GFPGANPlugin(BasePlugin):
device=device,
bg_upsampler=upscaler.model if upscaler is not None else None,
)
self.face_enhancer.face_helper.face_det.mean_tensor.to(device)
self.face_enhancer.face_helper.face_det.mean_tensor.to(face_det_device)
self.face_enhancer.face_helper.face_det = (
self.face_enhancer.face_helper.face_det.to(device)
self.face_enhancer.face_helper.face_det.to(face_det_device)
)
def __call__(self, rgb_np_img, files, form):