Giter VIP home page Giter VIP logo

customcam's Introduction

🎥 CustomCam

Extendable webcam customisation in Python.

CustomCam uses pyvirtualcamera to interact with virtual output devices. As this package was primarily developed for Linux, the Quick Start commands address that use case. To set up virtual output devices for other platforms, check the pyvirtualcam docs.

Quick Start

Install

pip install CustomCam                    # Install CustomCam
sudo apt install v4l2loopback-dkms       # Install virtual camera creator (Linux)

Launch

sudo modprobe v4l2loopback devices=1     # Create virtual camera (Linux)
CustomCam                                # Launch CustomCam

Usage

On-Launch

usage: CustomCam [-h] [--input_camera INPUT_CAMERA]
                 [--output_camera OUTPUT_CAMERA] [--fps]
                 [--pref_width PREF_WIDTH] [--pref_height PREF_HEIGHT]
                 [--pref_fps PREF_FPS]
                 [--filter {Gray,NoFilter,Segment,Sepia,Shake,BlurBox,Frame,Pixel,BlurSat}]
                 [--verbose] [--logfile]

🎥 CustomCam. Extendable webcam modification on your commandline.

optional arguments:
  -h, --help            show this help message and exit
  --input_camera INPUT_CAMERA
                        ID of webcam device (default: 0)
  --output_camera OUTPUT_CAMERA
                        Dummy output device (default: /dev/video2)
  --pref_width PREF_WIDTH
                        Overwrite camera width. (default: None)
  --pref_height PREF_HEIGHT
                        Overwrite camera height. (default: None)
  --pref_fps PREF_FPS   Overwrite camera fps. (default: None)
  --filter {Gray,NoFilter,Segment,Sepia,Shake,BlurBox,Frame,Pixel,BlurSat}
  --verbose             Enable verbose logging. (default: False)
  --logfile             Write log to disk. (default: False)

Mid-Run

Users are able to change the active filter, display statistics, flip the camera, close the program etc. whilst CustomCam is running by entering the appropriate command in the terminal in which CustomCam was launched.

Filters:
• 'BlurBox': Blur background via single face detection.
• 'BlurSat': Blur background via saturation detection.
• 'Frame': Highlight targets of face detection.
• 'Gray': Apply grayscale.
• 'NoFilter': Applies no filters.
• 'Pixel': Pixelate individuals in the foreground.
• 'Segment': Blur background using mediapipe's SelfieSegmentation.
• 'Sepia': Apply sepia effect.
• 'Shake': Shake two channels horizontally.

Options:
• 'f', 'flip': Flip camera
• 's', 'stats': Display statistics
• 'h', 'help': Get this help
• 'q', 'quit': Exit CustomCam

Creating your own filters

User-defined filters can be added to filters.py.

Filter classes must:

  • Inherit from filters.Filter
  • Implement a __str__ method that return string containing a short description of the filter.
  • Implement an apply method which takes a frame (as a np.array), applies filter logic and returns that a np.array.
  • Not share a name with any existing class or input command.

customcam's People

Contributors

mattravenhall avatar

Watchers

 avatar  avatar

Forkers

polauf

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.