Extendable webcam customisation in Python.
Project description
🎥 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 anp.array
), applies filter logic and returns that anp.array
. - Not share a name with any existing class or input command.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file CustomCam-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: CustomCam-0.0.2-py3-none-any.whl
- Upload date:
- Size: 11.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.56.0 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46fc8e0815a5aa1845745dc18c8408bb17c207c128e5a6135c59e2e823a557ff |
|
MD5 | 4380c00691256866debcc177c51fe6ad |
|
BLAKE2b-256 | bfd8f0507afb608b4e71af36179ef6242a92c131b03c147c6e31fe914be17060 |