Skip to content

Fast and accurate Automatic face blur tool that follows contour of the face πŸ‘¨β€πŸ¦² applicable in both image and video

Notifications You must be signed in to change notification settings

PSY222/AutomaticFaceBlur

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AutomaticFaceBlur πŸ‘¨β€πŸ¦²

Automatic face blur tool that follows contour of the face in both photos and videos.

"Why is every face blur using rectangular or circular shapes?"

This face blur tool started with this question. My face blur tool finds faces in an accurate and fast way using pretrained RetinaFace model. This tool stands out by generating a blur mask that precisely follows the contours of the face. I utilized dlib to create a custom polygon shape by connecting facial landmarks. You can apply this tool in both image and video data. I hope this tool can be helpful in creating visually comfortable face blurring :)

Here are some examples:

Street_people_short_after.mp4

How to use this repo πŸ™Œ

  1. Clone this repo
git clone <<repo link>>
  1. Navigate to 'model' folder
cd model
  1. Install required packages
pip install -r requirements.txt
  1. Run the command
python auto_blur.py -i <<input img or video path>> -o <<output img or video path>> -t <<type "img" or "video">>
  • If you are trying to blur the image : Type "img" for the -t argument.
  • If you are trying to blur the video : Type "video" for the -t argument.

Some useful tips 😎

  • Change the blur type or size!
    : Current blur is using GaussianBlur. You may try other types of blur such as median blur, blur, or bilateral filter. You can even adjust the density of blur by changing the blur size at auto_blur.py file.
  • Modify the code if you want to add sound to the video
    : You can add sound to the output video file by separately adding audio track or modifying code.

About

Fast and accurate Automatic face blur tool that follows contour of the face πŸ‘¨β€πŸ¦² applicable in both image and video

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages