Revert "Merge pull request #829 from RishonLi/patch-1"

This reverts commit 5f5fe8890a, reversing
changes made to a9e8f27360.
pull/844/head
Kenneth Estanislao 2024-12-16 22:46:39 +08:00
parent 5f5fe8890a
commit a1d9b73742
1 changed files with 1 additions and 4 deletions

View File

@ -49,10 +49,7 @@ def get_face_enhancer() -> Any:
with THREAD_LOCK: with THREAD_LOCK:
if FACE_ENHANCER is None: if FACE_ENHANCER is None:
model_path = os.path.join(models_dir, 'GFPGANv1.4.pth') model_path = os.path.join(models_dir, 'GFPGANv1.4.pth')
mps_device = None FACE_ENHANCER = gfpgan.GFPGANer(model_path=model_path, upscale=1) # type: ignore[attr-defined]
if torch.backends.mps.is_available():
mps_device = torch.device("mps")
FACE_ENHANCER = gfpgan.GFPGANer(model_path=model_path, upscale=1, device=mps_device) # type: ignore[attr-defined]
return FACE_ENHANCER return FACE_ENHANCER