Giter Club home page Giter Club logo

faceblur's Introduction

FaceBlur

Detect Face and Blur it (single face expected)

Python Code using OpenCV and a bit of numpy to find faces in still images and blur them.

Current version:

Takes as input the path of an image (in face_detect_tester.py) or a path full of images (in face_detect.py) and outputs the same image(s) with the face of the person included blurred, if found.
If many faces are there, only the largest face will be blurred. If no faces are there, nothing gets blurred. The output image is a BW version of the input Image.

Later Versions:

The current version outputs a BW version of the images, with the blur using a 1-0 mask. Later versions should:

  • output RGB-colored images
  • use Gaussian mask on the blur effect.
  • same methodology will be applied to videos using FFmpeg. Providing options of: Either producing a mask video to be used in any other video editing tool OR the video itself with the face blurred.

Tools used:

  • OpenCV & Numpy in Python
  • Pycharm

How to Use:

face_detect.py (for multiple images):

- Download and run for testering.

- For personal use:

1- Make sure the variable path has the correct path name leading to where your images are located. 2- Make sure the $cascPath$ variable leads to the file "haarcascade_frontalface_default.xml" 3- Changes the intensity to change the blur intensity. (0-> No blur, with blur increasing as number increases.) NB: The output files are written to the folder "Output Folder" in the same location of the .py file.

face_detect_tester.py (for testing a single image):

1- Make sure the variable imagePath has the correct path name leading to where your imageis located. 2- Make sure the $cascPath$ variable leads to the file "haarcascade_frontalface_default.xml" 3- Changes the intensity to change the blur intensity. (0-> No blur, with blur increasing as number increases.) NB: Output files are not written to any folder, only displayed.

Sample Outputs of current Version:

Output Input
All other inputs are in the folder: 'IMDB Celeb Faces'. All other outputs are in the 'Output Folder'.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.