Sign in

Make it live, have more fun!

In this last blog, we will walk you through how to put everything we have done into a live streaming version. After all this hard work, you can see yourself being recognized on your webcam!


The package we will use is imutils. Here are the essential packages for this section.

from import VideoStream
from import FPS
import numpy as np
import imutils
import pickle
import cv2
import os

The basic idea is we use VideoStream and FPS to open a pointer to the live stream and start the FPS timer. During the loop of each frame of the…

Two extensions of the face mask detector

As we talked about how to use FaceNet to basically check whether a person is wearing a mask or not, in this blog we will extend the system to include face mask-wearing correctness check and face recognition for both bare face and masked face.

Correctness check

To add this function, we first need to define what is the correct way to wear a mask. To efficiently avoid droplets spreading out when talking, the mask should cover both the nose and mouth.

Based on that we choose another dataset MAFA[1]. The dataset consists of 30, 811 Internet images, in which 35, 806 masked…

build a CNN model to classify if a person is wearing a mask or not

Living in the post-pandemic era, people are required to wear masks when they go shopping, to hospital, and even to work. We should carry the responsibility to the whole society while the business should also adopt more scrutiny operation to monitor the mask-wearing behavior. An accurate face mask detector with wearing guidance may not only enhance the entrance control in buildings, shopping malls, and groceries but also invoke people’s awareness of the severity of this dead-virus if not yet.

This project will walk you through the process of building a face mask detector with FaceNet. We will build the face…

Zishen Li

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store