Censor faces in a video

Using the ready-to-use cvlib library to use pre-trained models

Christophe Ferreira
6 min readNov 25, 2019
I’m not good at applying make-up

This is a 3 parts series where I play with cvlib:

  1. Implement people detection in a few minutes
  2. Implement face detection in a few minutes
  3. Censor faces in a video

In my second article about playing with people and face detection using cvlib, we took a screenshot when a person or a face is detected in the frame of the video. For fun, let’s add the ability to censor the face if one is detected.

You can read the previous article if you’d like to know how we got to this point but if you’re only interested in the code, you can see it below.

Censoring face with cvlib

We already know where the face is and the bounding box around the face. This means we already know the region we want to censor. But how are we going to do this?

We will simply use opencv to pixelate the region we want to censor by resize it to a smaller image with…

--

--