Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance Issue on macOS #815

Open
ViperGash opened this issue Dec 2, 2024 · 1 comment
Open

Performance Issue on macOS #815

ViperGash opened this issue Dec 2, 2024 · 1 comment

Comments

@ViperGash
Copy link

I am running on a macOS M4 with 128GB RAM. Without the enhance option, the performance is relatively smooth. Once I enable the enhance mode, the frame rate drops to approximately 0.2 - 0.3 FPS.

I tried --execution-threads 20 --max-memory 8, but it seems report an error:

Traceback (most recent call last):
  File "/Users/y/Downloads/Owned Tools/Deep-Live-Cam/run.py", line 6, in <module>
    core.run()
  File "/Users/y/Downloads/Owned Tools/Deep-Live-Cam/modules/core.py", line 250, in run
    limit_resources()
  File "/Users/y/Downloads/Owned Tools/Deep-Live-Cam/modules/core.py", line 151, in limit_resources
    resource.setrlimit(resource.RLIMIT_DATA, (memory, memory))
OverflowError: Python int too large to convert to C long

So I set --execution-threads to 20 and --max-memory to 7, but it doesn’t seem to improve performance.

Any suggenstion should I do to improve it?

@RishonLi
Copy link

You can try modifying face_enhancer.py face_enhancer.py#L52
by appending mps

            mps_device = None
            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]

I hope it's helpful to you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants