This Code: You can play with this code and test your own imagination as a starting point for face detection
This project is an implementation of a lazy-loaded face detection application using MediaPipe's Face Detection module and OpenCV. The application can process both static images and real-time video feeds from a webcam, applying face detection and annotations to the images and video frames.
- Lazy Loading: Face detection model is loaded only when required for the first time to optimize resource usage.
- Static Image Processing: Process and annotate static images with detected faces.
- Real-Time Webcam Detection: Detect and annotate faces in real-time using a webcam.
- Easy Integration: Structured to be easily integrated and expanded within other projects.
To run this project, you will need:
- Python 3.6+
- OpenCV
- MediaPipe
##Follow these steps to set up the project environment:
- git clone https://github.com/Rasmusalbertsson/face_detection.git
- cd mediapipe-face-detection
- pip install -r requirements.txt
- Process Static Images: Add image paths to the IMAGE_FILES list in the main function and run the script to process the images. Processed images will be saved with annotations.
- Webcam Face Detection: Run the script and face detection will start using your webcam. Press ESC to exit webcam mode. Contributing Contributions are welcome. Please fork the repository and submit a pull request with your features or corrections.
This project is licensed under the MIT License - see the LICENSE.md file for details.