BlurryFaces
A tool to blur faces or other regions in images and videos π€‘π
Install / Use
/learn @asmaamirkhan/BlurryFacesREADME
π΅οΈββοΈ Blurry Faces
A tool to blur faces or other regions in photos and videos π΅οΈβ
π Available Codes
- auto_blur_image: Detects and blurs faces (or objects) in a given image automatically due to a Tensorflow model
- auto_blur_video: Detects and blurs faces (or objects) in a given video due to a Tensorflow model
- manual_blur_image: Blurs manually selected faces (or objects)
π§π© Usage
- Clone or download this repo
- Open src folder in CMD
- Install required packages
pip install -r requirements.txt
For auto_blur_image.py:
- Run:
python auto_blur_image.py --input_image <PATH_TO_INPUT_JPG_FILE> --output_image <PATH_TO_OUTPUT_JPG_FILE> --model_path <PATH_TO_INPUT_PB_FILE> --threshold <THRESHOLD>
For auto_blur_video.py:
- Run:
python auto_blur_video.py --input_video <PATH_TO_INPUT_MP4_FILE> --output_video <PATH_TO_OUTPUT_MP4_FILE> --model_path <PATH_TO_INPUT_PB_FILE> --threshold <THRESHOLD>
For manual_blur_image.py:
-
Run:
python manual_blur_image.py --input_image <PATH_TO_INPUT_JPG_FILE> --output_image <PATH_TO_OUTPUT_JPG_FILE>- Select your ROI (Region of Interest)
- Press <kbd>Enter</kbd>
- Press <kbd>Q</kbd> to finish or any key to select another ROI
-
To see running options run for all codes:
python manual_blur_image.py --help -
TADAA π It's done π€
π€ Examples
For auto_blur_image.py:
<img src="./outputs/auto_blur_image.jpg" width="600" />
Threshold = 0.4
For auto_blur_video.py:

Threshold = 0.4
For manual_blur_image.py:

π Note
I am using face detection model in face_model folder that can detects faces but codes are valid for any .pb object detection model.
π References
π¦ΈββοΈ Project's Core Codes
- π TensorFlow Object Detection: check out this repo in case that you want to use the core code for other purpose
πΌ Contact
Find me on LinkedIn and feel free to mail me, Asmaa π¦
