1 Star 0 Fork 0

OpenBayes/MODNet

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

MODNet - WebCam-Based Portrait Video Matting Demo

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.

1. Requirements

The basic requirements for this demo are:

  • Ubuntu System
  • WebCam
  • Nvidia GPU with CUDA
  • Python 3+

NOTE: If your device does not satisfy the above conditions, please try our online Colab demo.

2. Introduction

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:

  • make sure the portrait and background are distinguishable, i.e., are not similar
  • run in soft and bright ambient lighting
  • do not be too close or too far from the WebCam
  • do not move too fast

3. Run Demo

We recommend creating a new conda virtual environment to run this demo, as follow:

  1. Clone the MODNet repository:

    git clone https://github.com/ZHKKKe/MODNet.git
    cd MODNet
    
  2. Download the pre-trained model from this link and put it into the folder MODNet/pretrained/.

  3. Create a conda virtual environment named modnet-webcam and activate it:

    conda create -n modnet-webcam python=3.6
    source activate modnet-webcam
    
  4. Install the required python dependencies (here we use PyTorch==1.0.0):

    pip install -r demo/video_matting/requirements.txt
    
  5. Execute the main code:

    python -m demo.video_matting.webcam
    
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openbayes/MODNet.git
git@gitee.com:openbayes/MODNet.git
openbayes
MODNet
MODNet
master

搜索帮助