This project takes a webcam stream and applies a learning-based segmentation algorithm to create a greenscreen effect.
The resulting image is provided as a virtual webcam.
It utilizes the U^2 Net segmentation model.
- OBS: https://obsproject.com/
- obs-virtual-cam: https://github.com/CatxFish/obs-virtual-cam/releases
- CUDA 10.2: https://developer.nvidia.com/cuda-10.2-download-archive
- Install python libraries:
pip install -r requirements.txt
- Big accurate model:
https://drive.google.com/file/d/1-Yg0cxgrNhHP-016FPdp902BR-kSsA4P - Small fast model:
https://drive.google.com/file/d/1rbSTGKAE-MTxBYHd-51l2hMOQPT_7EPy - Put big model in pretrained/u2net_human_seg
- Put small model in pretrained/u2netp
python virtual_greenscreen.py
- Select model
- Run
- In OBS, select "OBS-Camera" as camera