mtxslv / face_effect

Face blur effect coded in python for desktop application.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Welcome to face_effect!

I've always thought instagram/tiktok blur face effect is very aesthetic. I decided to create it myself, and the end result is in this repo, and you can use it yourself! Here it goes some results:

Original         Processed

Original         Processed

How to use it?

First you need to clone and install the project.

git clone https://github.com/mtxslv/face_effect
cd face_effect
poetry install .

Cast a shell to access the dependencies

poetry shell

Once this is done, you can interact with the effect via CLI. There are two main ways of doing so:

  • Webcam (real-time processing)
  • Image folder (batch processing)

The simplest CLI call opens your webcam and lets you see the full effect: blur + greyscale. To do so, just run:

python face_effect/cli.py

If you wanna see the effect in normal colors, just turn off the greyscale:

python face_effect/cli.py --e none

Now let's apply it on an image batch.

python face_effect/cli.py --s path

The terminal will ask you to input a valid full path. Once you do so, it asks an output path (another folder) to save the process images. If you want to save the images in the same place, just type a dot.

Limitations

The way the code is structured, it supposes only one person is visible. Tests with more than just one person were not performed.

The deep learning model employed has its own limitations. To know about them, refer to its Model Card here.

References

Code

Face Detections based on this example.

Test images

About

Face blur effect coded in python for desktop application.

License:Apache License 2.0


Languages

Language:Python 100.0%