Skip to content

A tool to blur faces or other regions in images and videos πŸ€‘πŸ”

License

Notifications You must be signed in to change notification settings

asmaamirkhan/BlurryFaces

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

25 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ•΅οΈβ€β™€οΈ Blurry Faces

A tool to blur faces or other regions in photos and videos πŸ•΅οΈβ€

πŸ™Œ Available Codes

  1. auto_blur_image: Detects and blurs faces (or objects) in a given image automatically due to a Tensorflow model
  2. auto_blur_video: Detects and blurs faces (or objects) in a given video due to a Tensorflow model
  3. manual_blur_image: Blurs manually selected faces (or objects)

πŸ”§πŸ”© Usage

  1. Clone or download this repo
  2. Open src folder in CMD
  3. Install required packages
    pip install -r requirements.txt

For auto_blur_image.py:

  1. 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:

  1. 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:

  1. 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
  2. To see running options run for all codes:

    python manual_blur_image.py --help
  3. TADAA πŸŽ‰ It's done πŸ€—

πŸ€— Examples

For auto_blur_image.py:

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

πŸ’Ό Contact

Find me on LinkedIn and feel free to mail me, Asmaa πŸ¦‹

Releases

No releases published

Packages

No packages published

Languages