mirror of
https://github.com/s4turns/face-filter
synced 2026-09-09 17:51:21 +00:00
master
face-filter
Composite your live webcam eyes and mouth onto any base image in real time. Use it as an OBS window capture source to appear as a photo, meme, or any face while chatting.
How it works
- You provide a base image (any photo with a clear frontal face)
- MediaPipe detects face landmarks on the base image once at startup
- Each webcam frame, your face is detected and your eyes and mouth are warped to match the base image's face geometry
- The result displays in a window — capture it in OBS with Window Capture
Requirements
- Python 3.9+
- Webcam
pip install opencv-python mediapipe numpy
The face landmark model (~29 MB) is downloaded automatically on first run.
Usage
python face_filter.py <base_image>
python face_filter.py "C:\Users\you\Pictures\photo.jpg"
A window opens showing the base image with your live eyes and mouth blended in. Two sliders let you tune the result:
| Slider | Effect |
|---|---|
| Pad | Expands the eye/mouth mask outward (default 20px) |
| Blur | Feathers the mask edges for a softer blend (default 8px) |
Press Q to quit.
OBS setup
- Run the script with your chosen base image
- In OBS: Add Source → Window Capture
- Select the Face Filter window
- Crop/resize the source to fit your scene
Base image tips
- Use a clear, frontal face photo with good lighting
- The face should be roughly the same size and angle you'll be at on webcam
- Works with photos, cartoons, memes — anything with a detectable face
Description
Composite your live webcam eyes and mouth onto any base image — use as OBS window capture source
85 KiB
Languages
Python
100%