Update face_enhancer.py
change if from before statement to elif, also fix conditional ladderpull/846/head
parent
47c8f7acc0
commit
ed7a21687c
|
@ -54,12 +54,12 @@ 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")
|
||||||
if platform.system() == "Darwin": # Mac OS
|
elif platform.system() == "Darwin": # Mac OS
|
||||||
mps_device = None
|
mps_device = None
|
||||||
if torch.backends.mps.is_available():
|
elif torch.backends.mps.is_available():
|
||||||
mps_device = torch.device("mps")
|
mps_device = torch.device("mps")
|
||||||
FACE_ENHANCER = gfpgan.GFPGANer(model_path=model_path, upscale=1, device=mps_device) # type: ignore[attr-defined]
|
FACE_ENHANCER = gfpgan.GFPGANer(model_path=model_path, upscale=1, device=mps_device) # type: ignore[attr-defined]
|
||||||
else: # Other OS
|
elif: # Other OS
|
||||||
FACE_ENHANCER = gfpgan.GFPGANer(model_path=model_path, upscale=1) # type: ignore[attr-defined]
|
FACE_ENHANCER = gfpgan.GFPGANer(model_path=model_path, upscale=1) # type: ignore[attr-defined]
|
||||||
return FACE_ENHANCER
|
return FACE_ENHANCER
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue