Detects and blurs any faces in a given image or video.
- Python3
- OpenCV
- Tensorflow
- MTCNN
pip3 install -r ./requirements.txt
face_blur utilizes predefined arguments upon execution. Input (-i) and output (-o) are both required. Resize image (-r) and skip frame (-s) are both optional. All video and image formats are supported.
Use the input argument (-i) to specify the image to blur. Then use the output argument (-o) to specify a write to file.
python3 face_blur.py -i image.jpg -o image_blurred.jpg
The input image can be resized to improve performance during processing. Use the resize argument (flagged as -r) to shrink the image. The argument value is the percent change in size.
python3 face_blur.py -i image.jpg -o image_resized_blurred.jpg -r 25
Use the input argument (-i) to specify the video to blur. Then use the output argument (-o) to specify a write to file.
python3 face_blur.py -i video.mp4 -o video_blurred.mp4
Frames can be skipped to improve performance during processing. Use the skip frame argument (flagged as -s) to reduce the number of frames for processing. The argument value indicates how frequently to skip a frame.
python3 face_blur.py -i video.mp4 -o video_skipped_blurred.mp4 -s 10