fangfufu / Linux-Fake-Background-Webcam

Faking your webcam background under GNU/Linux, now supports background blurring, animated background, colour map effect, hologram effect and on-demand processing.
GNU General Public License v3.0
1.6k stars 160 forks source link

Insane CPU usage #173

Open OtaK opened 2 years ago

OtaK commented 2 years ago

Hi!

I've been seeing some CPU usage threads with dual/quad cores being relatively used and I'm having quite the issue:

image

Yup. This program uses 100% of my 32-core Ryzen 9 5950X, causing issues with other things, cracking audio etc.

I have a small question, could it be possible to have a flag/feature-gated GPU-backed processing?

This is being quite bothersome as I'm currently using this program for business meetings and well, it basically prevents me from using my computer at the same time.

FYI I run this program with the following configuration:

width = 800
height = 600
fps = 30
background-image = blurred-bg.jpg
background-blur = 0
background-keep-aspect = yes
no-background = no
no-foreground = yes
no-postprocess = no
select-model = 0

Specs:

Thanks!

fangfufu commented 2 years ago

What is the version of your Python and OpenCV? Which distro are you using? I guess I need to write a frame rate limiter for higher performance machines.

OtaK commented 2 years ago

What is the version of your Python and OpenCV? Which distro are you using? I guess I need to write a frame rate limiter for higher performance machines.

Hi! Sorry for the late answer;

Python: 3.7.10 OpenCV: 4.5.4

As for my distro, I'm running Funtoo (up to date) with a 5.12.19-ck SMP PREEMPT kernel

systematiccaos commented 2 years ago

Same problem here:

OS: Arch Linux x86_64 Host: 20TL000KFR ThinkPad X1 Extreme Gen 3 Kernel: 5.16.1-arch1-1 Uptime: 2 hours, 12 mins Packages: 1101 (pacman), 15 (flatpak) Shell: fish 3.3.1 Resolution: 1920x1080, 1920x1080 WM: i3 Theme: Adwaita [GTK2/3] Icons: Adwaita [GTK2/3] Terminal: alacritty CPU: Intel i7-10850H (12) @ 5.100GHz GPU: Intel CometLake-H GT2 [UHD Graphics] GPU: NVIDIA GeForce GTX 1650 Ti Mobile Memory: 21182MiB / 64137MiB