Closed gekmihesg closed 3 years ago
I will test it tomorrow. What CPU do you have?
I tested this on a Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
Well, this is impressive. Thank you so much!
Hi, this is pretty cool.
Can you tell what was the main driver for the performance improvement?
How did you debug which call takes how long?
I can see in the manual https://google.github.io/mediapipe/solutions/selfie_segmentation.html they're doing some things like
` # To improve performance, optionally mark the image as not writeable to
image.flags.writeable = False`
which we don't seem to do in fake.py but I'm not sure if that actually would make a difference.
@ronny-rentner, basically rather than performing extra assignments, all the image processing are done in place. In another word, the variables themselves got modified without assignment operations.
In my test setup, this improved my frame rate from 10 FPS to around 30 FPS on 1920x1080 when running
./fake.py -w /dev/video99 -v /dev/video100 --threshold 50 -F60
(where /dev/video99 is a v4l2loopback device, delivering at 60 FPS). Functionality should remain unchanged. It's mostly just replacing some of the code with in-place operations.