Skip to content

Using neural nets for real-time background matting of a person.

License

Notifications You must be signed in to change notification settings

AmadejTratnik/background_subtractor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Real Time Background Subtraction

Official demo repository of real-time background matting of a person in foreground, as a result of diploma thesis.

Conference call

Our model can capture live webcam stream or video and produce background of a person in real time up to 30FPS, without the additional GPU or pre-captured background image.

Model architecture is based on FAST-SCNN network and optimized with ONNX Runtime accelerator.

Installation

Download the project from Github and change your current directory:

$ (base) cd background_subtractor

Use a virtual environment to isolate your environment, and install the required dependencies.

$ (base) python3 -m venv venv
$ (base) source venv/bin/activate
$ (venv) pip3 install -r requirements.txt

Background Subtraction

To start real time background subtraction, simply write:

$ (venv) python3 scripts/background_subtraction.py

By default, the script will run for 1000 frames, showing original picture, produced binary mask and final product of person's background subtraction in real time.

Error Handling

The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support.

$ (venv) pip3 uninstall opencv-python  
$ (venv) pip3 install opencv-python  

These 2 commands seem to solve the case.

Some more examples:

Conference call 2

Close up filming

Dynamic camera

About

Using neural nets for real-time background matting of a person.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages