Skip to content

diegovazquez/ASCIILinuxVirtualWebCam

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ascii Virtual Camera

Well, MS Teams dont have filters... so i implement my own.

Procedure

  1. Get input from camera
    alt text
  2. Get mask using Deeplab segmentation
    alt text
  3. Erode the mask
    alt text
  4. Input + Mask
    alt text
  5. Output
    alt text
  6. Output w/libcaca
    alt text
  7. Output w/libcaca + Custom Background
    alt textalt text

Result:
Video Example

References

Virtual Background

ASCII Art

Deeplab Model

Preparing Enviroment

Install conda

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
bash

Install dependencies

sudo apt install v4l2loopback-dkms libcaca0
conda install tensorflow-gpu opencv pillow  
pip install pyfakewebcam colour

Run

sudo apt install v4l2loopback-dkms
sudo modprobe -r v4l2loopback
sudo modprobe v4l2loopback devices=1 video_nr=20 card_label="v4l2loopback" exclusive_caps=1

python main.py

Options

usage: main.py [-h] [-vh HEIGHT] [-vw WIDTH] [-wc WEBCAM] [-fc FAKEWEBCAM]
               [-p PIXELSCALE] [-c CONTRAST] [-u [USECACA]]

optional arguments:
  -h, --help            show this help message and exit
  -vh HEIGHT, --height HEIGHT
                        Video height (default 640)
  -vw WIDTH, --width WIDTH
                        Video width (default 480)
  -wc WEBCAM, --webcam WEBCAM
                        Webcam device (default /dev/video0)
  -fc FAKEWEBCAM, --fakewebcam FAKEWEBCAM
                        Fake Webcam device (default /dev/video20)
  -p PIXELSCALE, --pixelscale PIXELSCALE
                        Pixel scale (default 0.15)
  -c CONTRAST, --contrast CONTRAST
                        Contrast adjustment (default 1)
  -u [USECACA], --usecaca [USECACA]
                        Use libcaca for ASCII transformation
  -bg BACKGROUND, --background BACKGROUND
                        Background image path

Changelog

  • 2020-05-10
    • [Added] Custom Background implementation
  • 2020-04-22
    • [Added] LibCaca implementation
  • 2020-04-21
    • [Added] Initial version

About

Virtual Webcam w/ASCII Filter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages