Project to detect face masks with social distancing in real time using YOLOv3, Haar Cascade and OpenCV
- Build and train CNN model with data augmentation to improve performance
- Capture the faces using Haar Cascade using the frames from input stream
- Use the trained model to detect mask on the faces
Instructions:
Build and train the CNN model:
python train_model.py
Use trained model for detection:
python detector.py
- Capture the frames from video using OpenCV and pass the frame through YOLOv3 to get the persons in the frame
- Social distancing is calculated using Euclidean distance between the persons detected
- The person detections are then passed through face_detection.model to extract the faces
- The pre-trained mask_detector.model uses the extracted faces to detect mask
Instructions:
Run the program:
python main.py
Exit program by pressing 'q' key