Implement face detection in a few minutes

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

Christophe Ferreira
7 min readNov 17, 2019
Photo by @chrisjoelcampbell — Unsplash

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

I wrote an article about my test with the cvlib library to detect people in a video and we will use that script as a base to improve and add face detection. You can read it if you’d like to know how the base script was built but if you’re just interested in the code, you can see it below.

Adding face detection

If you have run the script above, you may have noticed that when you’re too close to the camera, specifically if we don’t see your body, it does not always detect when a person is in the frame.

--

--