A tool to blur faces or other regions in photos and videos π΅οΈβ
- 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)
- Clone or download this repo
- Open src folder in CMD
- Install required packages
pip install -r requirements.txt
- 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>
- 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>
-
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 Enter
- Press Q 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 π€
Threshold = 0.4
Threshold = 0.4
I am using face detection model in face_model folder that can detects faces but codes are valid for any .pb
object detection model.
- π TensorFlow Object Detection: check out this repo in case that you want to use the core code for other purpose
Find me on LinkedIn and feel free to mail me, Asmaa π¦