Git Product home page Git Product logo

ms-teams-background-changer's Introduction

MS Teams background changer

Microsoft Teams on linux operating system does not have background effects like background blur or custom background image. This utility application enables these missing features to blur and add custom background image. It works on other video conference platform as well like Zoom, Google Meet and Skype.

We have used AI based image segmentation model DeepLab-V3 to segment person as foreground and the rest of the objects as a background and apply filters to it.

architecture

Installation

Install dependencies

sudo apt-get install v4l2loopback-dkms v4l-utils

v4l2loopback module is used to create virtual video devices. Therefore, all v4l2 applications will read the newly created virtual video device as a physical video device. This allows us to push modified video stream to the virtual camera and use it as a normal video feed coming from a physical camera device.

Install requirements

  • Python 3.x

Install python dependencies using

pip3 install -r requirements.txt

Usage

1.Create Virtual Camera

sudo modprobe v4l2loopback video_nr=20 card_name="Virtual Camera 1"

This will create a virtual camera with a device ID 20 and with a name Virtual Camera 1. If it's taken, change to different ID. Recommended to give higher number therefore there won't be a clash with other devices.

If you get this error

modprobe: ERROR: could not insert 'v4l2loopback': Operation not permitted

Try disablling "Secure Boot" option in BIOS settings. And if still doesn't work try installing v4l2loopback from source. Refer here for step by step process.

You can verify that by running

ls -1 /sys/devices/virtual/video4linux

and this should output something like video20.

2.Verify Virtual camera

Debug the list of physical and virtual camera using the command

v4l2-ctl --list-devices

And that will pop out information about all the integrated, connected(usb) and virtual camera along will associated device ID currently connected to the PC.

Virtual Camera 1 (platform:v4l2loopback-000):
	/dev/video20

Lenovo FHD Webcam Audio: Lenovo (usb-0000:00:14.0-4):
	/dev/video2
	/dev/video3

Integrated Camera: Integrated C (usb-0000:00:14.0-7):
	/dev/video0
	/dev/video1

3.Update Configurations

Edit configuration data in config.yaml file.

[V4L2]
# add virtual camera device ID
virtualDeviceID = /dev/video20 

Edit the input cameraID from which the realtime video stream should be fetched.

[stream]
# change input camera device ID 
CameraID = /dev/video2

edit the background settings in the configuration file.

[background]
# if blur = yes, only background will be blurred, background image is not added
# if blur = no, custom background image is added, blur effect is not applied
# blur_intensity should always be an odd number
blur = yes
blur_intensity = 11
image = images/workspace.jpg

4.Run application

Now we are ready to run the application,

python3 main.py

This should start to read the video feed from the input video camera, apply effects and push it to the Virtual camera. You can press ctrl+c to stop the application.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.