Click here to download the source code to this post In this tutorial, you will learn how to train a COVID-19 face mask detector with OpenCV, Keras/TensorFlow, and Deep Learning. Last month, I authored a blog post on detecting COVID-19 in X-ray images using deep learning. Readers really enjoyed learning from the timely, practical application of that tutorial, so today we are going to look at another COVID-related application of computer vision, this one on detecting face masks with OpenCV and Keras/TensorFlow. I was inspired to author this tutorial after: Receiving numerous requests from PyImageSearch readers asking that I write such a blog post Seeing others implement their own solutions (my favorite being Prajna Bhandary’s, which we are going to build from today) If deployed correctly, the COVID-19 mask detector we’re building here today could potentially be used to help ensure your safety and the safety of others (but I’ll leave that to the medical professionals to decide on, implement, and distribute in the wild). To learn how to create a COVID-19 face mask detector with OpenCV, Keras/TensorFlow, and Deep Learning, just keep reading! Looking for the source code to this post? JUMP RIGHT TO THE DOWNLOADS SECTION COVID-19: Face Mask Detector with OpenCV, Keras/TensorFlow, and Deep Learning In this tutorial, we’ll discuss our two-phase COVID-19 face mask detector, detailing how our computer vision/deep learning pipeline will be implemented. From there, we’ll review the dataset we’ll be using to train our custom face mask detector. I’ll then show you how to implement a Python script to train a face mask detector on our dataset using Keras and TensorFlow. We’ll use this Python script to train a face mask detector and review the results. Given the trained COVID-19 face mask detector, we’ll proceed to implement two more additional Python scripts used to: Detect COVID-19 face masks in images Detect face masks in real-time video streams We’ll wrap up the post by looking at the results of applying our face mask detector. I’ll also provide some additional suggestions for further improvement. Two-phase COVID-19 face mask detector Figure 1: Phases and individual steps for building a COVID-19 face mask detector with computer vision and deep learning using Python, OpenCV, and TensorFlow/Keras. In order to train a custom face mask detector, we need to break our project into two distinct phases, each with its own respective sub-steps (as shown by Figure 1 above): Training: Here we’ll focus on loading our face mask detection dataset from disk, training a model (using Keras/TensorFlow) on this dataset, and then serializing the face mask detector to disk Deployment: Once the face mask detector is trained, we can then move on to loading the mask detector, performing face detection, and then classifying each face as with_mask or without_mask We’ll review each of these phases and associated subsets in detail, but in the meantime, let’s take a look at the dataset we’ll be using to train our COVID-19 face mask detector.
Stars
2
Forks
0
Watchers
2
Open Issues
0
Overall repository health assessment
No package.json found
This might not be a Node.js project
15
commits