This project aims to develop a real-time system to detect if a human face is covered with masks, sunglasses, caps, or hoodies. The system is designed for applications in security monitoring, ATM security, and access control.
- TensorFlow/Keras
- OpenCV
- FastAPI
- AWS S3
- Ngrok
Unauthorized individuals covering their faces in restricted areas pose security concerns. This project implements a computer vision system to identify and alert when faces are covered by masks, sunglasses, caps, or hoodies.
- Internet
- Custom datasets
- Acceptable: Faces without any coverings.
- Alarming: Faces with masks, sunglasses, caps, or hoodies.
- Image resizing to 224x224 pixels.
- Normalization.
Using Python scripts to download and categorize images.
- Resizing images using OpenCV.
- Normalizing pixel values.
Organized in folders ('Acceptable' and 'Alarming') and uploaded to AWS S3 for access.
- Base Model: ResNet50 pre-trained on ImageNet.
- Custom Layers: Added custom dense and output layers for binary classification.
- Split dataset into training and testing sets.
- Used augmentation techniques for better generalization.
- Metrics: Accuracy, loss.
- Tools: TensorFlow/Keras.
- Validation on test set.
- Metrics: Test accuracy, confusion matrix, and classification report.
FastAPI for serving the model.
/start_prediction: Start video capture and prediction./stop_prediction: Stop video capture.
Used to expose the local server to the internet.
Using OpenCV to access webcam and display predictions on video frames.
- Preprocessing each frame.
- Making predictions using the trained model.
- Displaying results on the video stream.
- Data Collection: Sourcing a diverse dataset.
- Model Accuracy: Improving accuracy through data augmentation and fine-tuning.
- Real-Time Processing: Optimizing prediction speed for real-time use.
- Increase dataset size and diversity.
- Enhance model accuracy and speed.
- Integrate with security systems.
- Develop a mobile application for on-the-go use.
This project successfully implements a computer vision system for detecting face coverings in real-time, enhancing security by providing timely alerts.
For any questions, feel free to reach out to me.