Skip to content

Commit

Permalink
Update face_enhancer.py
Browse files Browse the repository at this point in the history
change if from before statement to elif, also fix conditional ladder
  • Loading branch information
hacksider committed Dec 23, 2024
1 parent 47c8f7a commit ed7a216
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/processors/frame/face_enhancer.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ def get_face_enhancer() -> Any:
with THREAD_LOCK:
if FACE_ENHANCER is None:
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
if torch.backends.mps.is_available():
elif 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]
else: # Other OS
elif: # Other OS
FACE_ENHANCER = gfpgan.GFPGANer(model_path=model_path, upscale=1) # type: ignore[attr-defined]
return FACE_ENHANCER

Expand Down

1 comment on commit ed7a216

@pedrodanielsantos
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After this change I get an indentation error when I try to turn on the face enhancer, could it be related?
Posted about it here

Please sign in to comment.