Mediapipe runs so much faster. You might want to give it a try. https://google.github.io/mediapipe/ My implementation now uses mediapipe. https://github.com/fangfufu/Linux-Fake-Background-Webcam/