Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Person Blocker - Automatically "block" people in images (like Black Mirror)


Recommended Posts

Posted

This could be useful for school photos (not to mention Article 17 of the GDPR). :)

 

Download (GitHub)

 

A script to automatically "block" people in images (like the Black Mirror episode White Christmas) using Mask R-CNN pretrained on the MS COCO dataset. No GPU required!

 

But you can block more than just people: up to 80 different types of objects can be blocked, including giraffes and busses!

 

Usage

Person Blocker is used from the command line:

 

python3 person_blocker.py -i images/img3.jpg -c '(128, 128, 128)' -o 'bus' 'truck'

 

Requirements

The same requirements as Mask R-CNN:

 

  • Python 3.4+
  • TensorFlow 1.3+
  • Keras 2.0.8+
  • Numpy, skimage, scipy, Pillow, cython, h5py

plus matplotlib and imageio

 

 

Examples

 

python3 person_blocker.py -i images/img2.jpg -c '#c0392b' -o 'giraffe'

 

img2_blocked.png

 

python3 person_blocker.py -i images/img3.jpg -c '(128, 128, 128)' -o 'bus' 'truck'

 

img3_blocked.png

 

Blocking specific object(s) requires 2 steps: running in inference mode to get the object IDs for each object, and then blocking those object IDs.

 

python3 person_blocker.py -i images/img4.jpg -l

 

JWyXcb.png

 

python3 person_blocker.py -i images/img4.jpg -o 1

 

img4_blocked.png

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...