This code allows for images or videos to be altered to protect the identities of individuals in the pictures. Using opencv face and eye detectors, faces can be blurred out or eyes can be blacked out.
Blocked Eyes | Blurred Face |
---|---|
- Python 3.x
- Opencv
To alter an image, use the following:
python media_scrubber.py --input '/path/to/image.jpg' --mode 'block_eyes'
The default mode is to blur faces. Videos can also be altered frame by frame, though the current setting only retains one fifth of the frames. This can be altered with the argument --frame_ratio
. Outputs are stored in the output directory with the same name as the input, along with a prefix indicating the kind of alteration.
I whipped this up in a few hours so it's not too great. This heavily relies on the Haar cascade detectors provided in opencv. This is a mainly a proof of concept exercise. The motivation was to demonstrate the capability of technology to allow for visibility of resistance while still protecting the identites of individuals, especially following the tragic fate of some Ferguson protesters.
Black Lives Matter