This is a MODNet portrait video matting demo based on WebCam. It will call your local WebCam and display the matting results in real time.
The basic requirements for this demo are:
NOTE: If your device does not satisfy the above conditions, please try our online Colab demo.
We use ~400 unlabeled video clips (divided into ~50,000 frames) downloaded from the internet to perform SOC to adapt MODNet to the video domain. Nonetheless, due to insufficient labeled training data (~3k labeled foregrounds), our model may still make errors in portrait semantics estimation under challenging scenes. Besides, this demo does not currently support the OFD trick, which will be provided soon.
For a better experience, please:
We recommend creating a new conda virtual environment to run this demo, as follow:
Clone the MODNet repository:
git clone https://github.com/ZHKKKe/MODNet.git
cd MODNet
Download the pre-trained model from this link and put it into the folder MODNet/pretrained/
.
Create a conda virtual environment named modnet-webcam
and activate it:
conda create -n modnet-webcam python=3.6
source activate modnet-webcam
Install the required python dependencies (here we use PyTorch==1.0.0):
pip install -r demo/video_matting/requirements.txt
Execute the main code:
python -m demo.video_matting.webcam
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。