Portrait Matting (Videos, Images, and Webcam) based on MODNet Algorithm
- Ubuntu System
- Python 3+
- Webcam
- Create Virtual Environment
conda create -n matting python==3.11.9
conda activate matting
- Clone Repository
git clone https://github.com/Zeeshann1/Real-Time-Portrait-Video-Matting.git
cd Real-Time-Portrait-Video-Matting.git
- Install Requirements
Install the required python dependencies (please make sure your CUDA version is supported by the PyTorch version installed):
pip install -r demo/video_matting/custom/requirements.txt
pip install -r demo/video_matting/webcam/requirements.txt
- Webcam Matting
Real-time portrait video matting demo based on WebCam. It will call your local WebCam and display the matting results in real time. The demo can run under CPU or GPU.
python -m demo.video_matting.webcam.run
- Local Video Matting
Real-time portrait video matting demo that allows you to process custom videos.
python -m demo.video_matting.custom.run --video YOUR_VIDEO_PATH
- Image Matting
Please try MODNet portrait image matting demo through online Colab demo. Image Demo