I made a webpage to produce virtual background with webcam.
https://knok.github.io/virtbg/
Sorcecode:
https://github.com/knok/knok.github.io/tree/master/virtbg
Some online meeting software (Zoom, Microsoft Teams) supports virtual background, but I want to use other software like Jitsi (or google meet), so I made it.
To make this, I referred the article “Open Source Virtual Background”.
The following figure is the diagram.
![](https://blog.daionet.gr.jp/knok-e/files/2020/05/image.png)
It depends on docker, GPU, v4l2loopback (only works on Linux), so I want to make more generic solution. To make as a webpage, and using OBS
Studio with plugins (obs-v4l2sink, OBS-VirtualCam or OBS (macOS) Virtual Camera) you can use the solution on more platforms.
To make as a single webpage, I can reduce overhead using inter-process commuication using http via docker.
This is an example animation:
![y4069-ju7wv.gif](https://qiita-user-contents.imgix.net/https%3A%2F%2Fqiita-image-store.s3.ap-northeast-1.amazonaws.com%2F0%2F31714%2F07218b62-6c6d-34ab-d382-bf4ebace5361.gif?ixlib=rb-1.2.2&auto=format&gif-q=60&q=75&s=ae73c72b0e9ade674ab930f7630357c3)
Using jisti snapshot:
![image.png](https://qiita-user-contents.imgix.net/https%3A%2F%2Fqiita-image-store.s3.ap-northeast-1.amazonaws.com%2F0%2F31714%2Fc9ad3e1b-4823-6ec6-d163-45c1d62873eb.png?ixlib=rb-1.2.2&auto=format&gif-q=60&q=75&s=1dee24016c5ac9ffbc188b3568a12ed9)
Unfortunately, BodyPix releases only pretraind models, no training data.
I need more improvements:
- Accept any background images
- Suppot choose camera device
- Useful UI