Linux-Fake-Background-Webcam icon indicating copy to clipboard operation
Linux-Fake-Background-Webcam copied to clipboard

What is your CPU? How many FPS are you getting?

Open fangfufu opened this issue 4 years ago • 22 comments

Please comment below with your CPU model and the FPS you are getting. I want to conduct a survey on the performance of this software. https://github.com/fangfufu/Linux-Fake-Background-Webcam/commit/2f7d6988a3275b8aa4cbc73bed8151666c5aedef introduced significant performance improvement.

fangfufu avatar Sep 14 '21 09:09 fangfufu

Negligible improvement on my machine, fluctuating around 14fps before to 16fps now even when disable both foreground and background (it is stable at 30 with both on multithreaded branch). My CPU model is R7-4800U.

Tkrtt avatar Sep 14 '21 14:09 Tkrtt

@Kraautokratt , please try the script introduced by https://github.com/fangfufu/Linux-Fake-Background-Webcam/pull/161

fangfufu avatar Sep 14 '21 15:09 fangfufu

Mine after turning off Folding@Home and turning the CPU frequency limited off. (I normally limit my CPU frequency to 2.80 GHz to lower the temperature)

1920x1080@60 for 180 seconds
HEAD: 5f5d90cba4f2ef99bc3ed2cdcf4ee5509f303259

Linux 5.10.0-8-amd64 #1 SMP Debian 5.10.46-4 (2021-08-03) x86_64 GNU/Linux
      8 Intel(R) Core(TM) i7-4900MQ CPU @ 2.80GHz

python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110]
virtualenv False

numpy 1.19.5
opencv-python 4.5.3.56
pyfakewebcam 0.1.0
mediapipe 0.8.7.1
inotify_simple 1.3.5
cmapy 0.6.6
ConfigArgParse 1.5.2

avg 31.75, stdev 1.17

fangfufu avatar Sep 14 '21 15:09 fangfufu

Copied from https://github.com/fangfufu/Linux-Fake-Background-Webcam/pull/161#issue-996145209

1920x1080@60 for 180 seconds
HEAD: 2f7d6988a3275b8aa4cbc73bed8151666c5aedef

Linux 5.14.2-arch1-2 #1 SMP PREEMPT Thu, 09 Sep 2021 09:42:35 +0000 x86_64 GNU/Linux
     12 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz

python 3.9.7 (default, Aug 31 2021, 13:28:12) 
[GCC 11.1.0]
virtualenv True

numpy 1.21.2
opencv-python 4.5.3.56
pyfakewebcam 0.1.0
mediapipe 0.8.7.3
inotify_simple 1.3.5
cmapy 0.6.6
ConfigArgParse 1.5.2

avg 32.74, stdev 4.36

fangfufu avatar Sep 14 '21 15:09 fangfufu

Ah. It seems to be akvcam's problem. When I changed to v4l2loopback it is smooth as butter.

1920x1080@60` for 180 seconds
HEAD: 5f5d90cba4f2ef99bc3ed2cdcf4ee5509f303259
  
Linux 5.10.64-1-lts #1 SMP Sun, 12 Sep 2021 13:59:58 +0000 x86_64 GNU/Linux
     16 AMD Ryzen 7 4800U with Radeon Graphics
python 3.9.7 (default, Sep  1 2021, 18:48:07) 
[GCC 11.1.0]
virtualenv False

numpy 1.21.2
opencv-python 4.5.3.56
pyfakewebcam 0.1.0
mediapipe 0.8.7.2
inotify_simple 1.3.5
cmapy 0.6.6
ConfigArgParse 1.5.2

INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
avg 27.97, stdev 5.29"

Tkrtt avatar Sep 15 '21 02:09 Tkrtt

Here's mine:

1920x1080@60 for 180 seconds
HEAD: 5f5d90cba4f2ef99bc3ed2cdcf4ee5509f303259

Linux 5.14.0-7.1-liquorix-amd64 #1 ZEN SMP PREEMPT liquorix 5.14-5ubuntu1~hirsute (2021-09-22) x86_64 GNU/Linux
      4 AMD A8-7650K Radeon R7, 10 Compute Cores 4C+6G

python 3.9.5 (default, May 11 2021, 08:20:37) 
[GCC 10.3.0]
virtualenv False

numpy 1.19.5
opencv-python 4.5.3.56
pyfakewebcam 0.1.0
mediapipe 0.8.7.3
inotify_simple 1.3.5
cmapy 0.6.6
ConfigArgParse 1.5.2

INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
avg 21.68, stdev 0.79
./benchmark.sh: 29: kill: No such process

chrsrns avatar Sep 23 '21 10:09 chrsrns

I've seen a noticable improvement of FPS recently (probably with 2f7d698). They used to fluctuate around 22 and now stay close to 30 FPS most of the time:

1920x1080@60 for 180 seconds
HEAD: ec67c26b06142287ed22b495ca5d0fd6b7e9b5c6

Linux 5.10.61-gentoo #1 SMP PREEMPT Thu Sep 23 21:17:57 CEST 2021 x86_64 GNU/Linux
     16 Intel(R) Core(TM) i7-10875H CPU @ 2.30GHz

python 3.9.6 (default, Sep 15 2021, 12:04:05) 
[GCC 9.3.0]
virtualenv True

numpy 1.21.2
opencv-python 4.5.3.56
pyfakewebcam 0.1.0
mediapipe 0.8.7.3
inotify_simple 1.3.5
cmapy 0.6.6
ConfigArgParse 1.5.2

INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
avg 29.66, stdev 2.34

Manu311 avatar Sep 29 '21 10:09 Manu311

1920x1080@60 for 180 seconds HEAD: ec67c26b06142287ed22b495ca5d0fd6b7e9b5c6

Linux 5.11.0-27-generic #29~20.04.1-Ubuntu SMP Wed Aug 11 15:58:17 UTC 2021 x86_64 GNU/Linux 4 Intel(R) Core(TM) i5-3320M CPU @ 2.60GHz

python 3.8.10 (default, Sep 28 2021, 16:10:42) [GCC 9.3.0] virtualenv False

numpy 1.21.0 opencv-python 4.5.2.54 pyfakewebcam 0.1.0 mediapipe 0.8.7.1 inotify_simple 1.3.5 cmapy 0.6.6 ConfigArgParse 0.13.0

INFO: Created TensorFlow Lite XNNPACK delegate for CPU. avg 19.51, stdev 1.14

katakombi avatar Oct 12 '21 20:10 katakombi

INFO: Created TensorFlow Lite XNNPACK delegate for CPU. avg 10.27, stdev 0.32 Press any key to continue...

920x1080@60 for 180 seconds HEAD: 80f04cf8762e31fad55a90bc5559c07f6e94c6b2

Linux 5.14.16-201.fc34.x86_64 #1 SMP Wed Nov 3 13:57:29 UTC 2021 x86_64 GNU/Linux 12 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz

python 3.9.7 (default, Aug 30 2021, 00:00:00) [GCC 11.2.1 20210728 (Red Hat 11.2.1-1)] virtualenv False

numpy 1.21.4 opencv-python 4.5.4.58 pyfakewebcam 0.1.0 mediapipe 0.8.9 inotify_simple 1.3.5 cmapy 0.6.6 ConfigArgParse 1.5.3

INFO: Created TensorFlow Lite XNNPACK delegate for CPU. avg 35.40, stdev 3.34

lmann99 avatar Nov 14 '21 15:11 lmann99

1920x1080@60 for 180 seconds HEAD: 80f04cf8762e31fad55a90bc5559c07f6e94c6b2

Linux 5.10.0-9-amd64 #1 SMP Debian 5.10.70-1 (2021-09-30) x86_64 GNU/Linux 8 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz

python 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110] virtualenv False

numpy 1.21.2 opencv-python 4.5.3.56 pyfakewebcam 0.1.0 mediapipe 0.8.7.2 inotify_simple 1.3.5 cmapy 0.6.6 ConfigArgParse 1.5.2

avg 38.38, stdev 1.98

Frame rate is good but I wonder why it takes so much more CPU than Mediapipe in Google Meet running in the browser. Does anyone have any idea? Is Mediapipe in the browser using the GPU maybe? I unfortunately only have an Intel GPU and no Nvidia GPU.

ronny-rentner avatar Nov 15 '21 09:11 ronny-rentner

Cant say much about the reasons but this project uses OpenCV and mediapipe and it uses way less CPU for me https://github.com/blueOkiris/bgrm

katakombi avatar Nov 15 '21 12:11 katakombi

@katakombi , what's their FPS?

fangfufu avatar Nov 16 '21 21:11 fangfufu

I think its between 20 and 24

katakombi avatar Nov 16 '21 21:11 katakombi

@katakombi Did you get errors when building/running said project? I would like to see it for myself in my machine, but errors occurred when running the project.

chrsrns avatar Nov 17 '21 13:11 chrsrns

Yeah it was a bit difficult! I don't remember what I had installed but definitely it required python3.9. The release contains a deb / arch package, and if you patch the control you can install it under ubuntu.

katakombi avatar Nov 17 '21 13:11 katakombi

I was getting a Inappropriate ioctl for device error, with no similar issues reported. I'm thinking it's because I'm using a Droidcam camera, but it's a wild guess.

chrsrns avatar Nov 17 '21 15:11 chrsrns

Could we keep this thread on-topic please? If you have a bug that you want to report / if you have a question, please open another issue. :)

fangfufu avatar Nov 17 '21 16:11 fangfufu

Not using that benchmark script right now, but here are some details from me using an mp4 as background. Linux: Linux 5.15.5-zen1-1-zen #1 ZEN SMP PREEMPT Thu, 25 Nov 2021 22:09:35 +0000 x86_64 GNU/Linux CPU: 6 Core's HT Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz Python: v3.9

numpy                 1.21.4
opencv-python         4.5.4.60
pyfakewebcam          0.1.0
mediapipe             0.8.9
inotify-simple        1.3.5
cmapy                 0.6.6
ConfigArgParse        1.5.3

Having all non-essential applications closed i get around 29 FPS (Though it does sometimes fallback to around 15 FPS for some reason, and when this happens the CPU usage also halves). CPU Is using around 30%-25%, Resident Memory is around 310MB

BlackDex avatar Dec 03 '21 10:12 BlackDex

1920x1080@60 for 180 seconds HEAD: 2d920dc04c3cb83689dc9b3e75f931b3e0835753

Linux 5.15.11-zen1-1-zen #1 ZEN SMP PREEMPT Wed, 22 Dec 2021 09:23:53 +0000 x86_64 GNU/Linux 8 Intel(R) Core(TM) i3-10100F CPU @ 3.60GHz

python 3.10.1 (main, Dec 11 2021, 17:22:55) [GCC 11.1.0] virtualenv False

numpy 1.22.2 opencv-python 4.5.5.62 pyfakewebcam 0.1.0 mediapipe 0.8.9.1 inotify_simple 1.3.5 cmapy 0.6.6 ConfigArgParse 1.5.3

INFO: Created TensorFlow Lite XNNPACK delegate for CPU. avg 34.45, stdev 1.54

jansenmtan avatar Feb 08 '22 03:02 jansenmtan

Great performance here with about 45% load on all threads while running the benchmark:

1920x1080@60 for 180 seconds
HEAD: 2d920dc04c3cb83689dc9b3e75f931b3e0835753

Linux 5.10.0-11-amd64 #1 SMP Debian 5.10.92-1 (2022-01-18) x86_64 GNU/Linux
     12 Intel(R) Core(TM) i7-10850H CPU @ 2.70GHz

python 3.9.2 (default, Feb 28 2021, 17:03:44) 
[GCC 10.2.1 20210110]
virtualenv False

numpy 1.19.5
opencv-python 4.5.3.56
pyfakewebcam 0.1.0
mediapipe 0.8.9.1
inotify_simple 1.3.5
cmapy 0.6.6
ConfigArgParse 1.5.3

avg 39.92, stdev 1.31

grizewald avatar Feb 14 '22 07:02 grizewald

1920x1080@60 for 180 seconds HEAD: 29d4c43dc9d827a11be724b867d23be35dba30ec

Linux 5.18.13-100.fc35.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jul 22 14:20:24 UTC 2022 x86_64 GNU/Linux 6 Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz

python 3.9.13 | packaged by conda-forge | (main, May 27 2022, 16:56:21) [GCC 10.3.0] virtualenv True

numpy 1.23.1 opencv-python 4.6.0.66 pyfakewebcam 0.1.0 mediapipe 0.8.10.1 inotify_simple 1.3.5 cmapy 0.6.6 ConfigArgParse 1.5.3 protobuf 3.20.1

INFO: Created TensorFlow Lite XNNPACK delegate for CPU. avg 37.26, stdev 2.51

krllus avatar Jul 29 '22 14:07 krllus

Is this okay for Logitech C270 "Max Resolution: 720p/30fps"? Thanks!

1920x1080@60 for 180 seconds
HEAD: e8dfa5e82f932a57148dcf1f33bd25f263bd38f1

Linux 5.15.0-87-generic #97-Ubuntu SMP Mon Oct 2 21:09:21 2023 x86_64 GNU/Linux
      4 Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz

python 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0]
virtualenv False

numpy 1.26.1
opencv-python 4.8.1.78
pyfakewebcam 0.1.0
mediapipe 0.10.7
inotify_simple 1.3.5
cmapy 0.6.6
ConfigArgParse 1.5.5
protobuf 3.20.2

INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
avg 19.90, stdev 1.27

firepainting avatar Oct 30 '23 10:10 firepainting