No project description provided
Project description
FaceGuard
FaceGuard is a computer vision filter that automatically detects and blurs faces in video streams using OpenCV's YuNet face detection model. Perfect for privacy-conscious applications that need real-time face anonymization.
Demo
Here are some examples of FaceGuard in action:
Quick Start
The easiest way to run FaceGuard is using the provided usage script:
# Basic usage with default settings
python scripts/filter_usage.py
# Custom video input
VIDEO_INPUT="./data/your-video.mp4" python scripts/filter_usage.py
# Custom configuration
FILTER_DETECTION_CONFIDENCE_THRESHOLD=0.3 FILTER_BLUR_STRENGTH=2.0 python scripts/filter_usage.py
Environment Variables
The filter can be configured using environment variables:
| Variable | Default | Description |
|---|---|---|
VIDEO_INPUT |
./data/video-01.mp4 |
Input video file path |
OUTPUT_VIDEO_PATH |
./output/{input_name}_blurred.mp4 |
Output video file path |
OUTPUT_FPS |
30 |
Output video frames per second |
WEBVIS_PORT |
8000 |
Port for Webvis visualization |
FILTER_DETECTOR_NAME |
yunet |
Face detector type |
FILTER_BLURRER_NAME |
gaussian |
Blur algorithm type |
FILTER_BLUR_STRENGTH |
1.0 |
Blur intensity |
FILTER_DETECTION_CONFIDENCE_THRESHOLD |
0.25 |
Minimum confidence for face detection |
FILTER_DEBUG |
False |
Enable debug logging |
FILTER_FORWARD_UPSTREAM_DATA |
True |
Forward data from upstream filters |
FILTER_INCLUDE_FACE_COORDINATES |
True |
Include face coordinates in frame data |
Viewing Results
After running the filter, you can view the results at:
- Webvis:
http://localhost:8000- Real-time video stream - Output Video: Check the
./output/directory for the processed video file
Documentation
For detailed information about configuration options, performance tuning, and advanced usage, see the comprehensive documentation.
Features
- Real-time Face Detection: Uses OpenCV's YuNet model for accurate face detection
- Configurable Blurring: Adjustable blur strength and detection sensitivity
- Rich Metadata: Face coordinates, confidence scores, and detection details
- Environment Variable Configuration: No command-line arguments needed
- Upstream Data Forwarding: Passes through data from other filters
- Debug Mode: Optional logging for development and troubleshooting
Install
To install the filter and its dependencies:
# Create and activate virtual environment
virtualenv venv
source venv/bin/activate
# Install the filter
make install
Run locally
To run the filter locally:
make run
Then navigate to http://localhost:8000 to see the video stream.
Run in Docker
Build and run the filter in Docker:
# Build the Docker image
make build-image
# Run the filter
make run-image
Navigate to http://localhost:8000 to view the video stream.
Testing
Run the test suite:
make test
Project details
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file filter_faceblur-1.2.0-py3-none-any.whl.
File metadata
- Download URL: filter_faceblur-1.2.0-py3-none-any.whl
- Upload date:
- Size: 16.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2acccb079c976c122f19ea5649d4c5ad8283d7d255f7d28bd98c76a964fb7a40
|
|
| MD5 |
6dc23c759369e3ab4f55f40da8eebe72
|
|
| BLAKE2b-256 |
8d09606c83e5eadcf38a2fe50e7efa0966ef4274f0cdb985a12a6404db0ced7f
|