Virtual camera that displays closest face match from a data set
You want to show your emotions on the internet but don't want to leak your identity? You want to see that you are just one of thousands of people? You want to express yourself with people from your favorite TV-episode? Koh (aka "AI has many faces")
can help you with this!
Koh analyses your face features from your webcam and shows the closest matching face from a given dataset. This creates an interesting effect, which you can show of as a virtual camera in your next video conference or live-stream.
- record webcam π€π€³
- track face point
- train on face dataset πͺ
- get closest face match from dataset β
- use csv-files for better mixing datasets π₯
- only match certain face features π
- use match as virtual camera π·
Look at mediapipe/getting_startet
β Make a virtual environment (optional)
python3 -m venv mp_env && source mp_env/bin/activate
Install dependencies
pip3 install -r requirements.txt
Download a face data set and save it in a folder in this directory.
If you want to use a video make an image sequence out of it. Either use your video-editor of your choice (Blender) or use this ffmpeg command:
ffmpeg -i "[video file]" dataset/[name]/image%04d.jpg
Input the relative path in the train.py
script
./train.py [path/to/your/dataset]
After you trained with your data set a file namend after the path should appear [path_to_your_dataset].csv
.
Input the relative path of that file into the main.py
./main.py [path_to_your_dataset].csv
If everthing went good two windows should appear. One shows your webcam with the wireframe of your face. The other window shows the matched face from your dataset.
- Mediapipe
- OpenCV
- virtual camera
- Koh - character from Avatar the last air bender
- The Scramble Suit - A Scanner Darkly (2006)
- "Reflection" by Shane Cooper (ZKM)
- v-tuber, FaceRig
- Gero Beckmann - Initial work - Geronymos
This project is licensed under the GPT-3 License - see the LICENSE
file for details