🚀 This futuristic project showcases real-time age and gender detection using advanced computer vision techniques and deep learning models. The application harnesses the power of artificial intelligence to analyze video streams from the camera, detect faces using a cutting-edge OpenCV face detection model, and accurately determine the age and gender of individuals. Based on these attributes, the application dynamically delivers personalized video ads for a captivating and engaging user experience.
- Real-time age and gender detection powered by state-of-the-art deep learning models
- Intelligent selection of video ads tailored to individual age and gender profiles
- Seamless display of video ads during face detection for an immersive visual experience
- Simultaneous detection of multiple faces in a single frame for enhanced performance
- Python 3.6 or higher
- OpenCV 4.5 or newer
- Pretrained deep learning models included in the project:
- OpenCV face detection model:
opencv_face_detector.pbtxt
opencv_face_detector_uint8.pb
- Age prediction model:
age_deploy.prototxt
age_net.caffemodel
- Gender prediction model:
gender_deploy.prototxt
gender_net.caffemodel
- OpenCV face detection model:
- Clone the repository:
git clone https://github.com/Abdullah-129/InstantInsight-AI-Age-Gender-Recognition.git
- Install the required dependencies:
pip install -r requirements.txt
- Download the required model files:
- OpenCV face detection model:
opencv_face_detector.pbtxt
opencv_face_detector_uint8.pb
- Age prediction model:
age_deploy.prototxt
age_net.caffemodel
- Gender prediction model:
gender_deploy.prototxt
gender_net.caffemodel
- OpenCV face detection model:
- Place the downloaded model files in the project directory.
- Run the following command to start the application:
python main.py
- The application will open a window displaying the live camera feed.
- When a face is detected, the application will determine the age and gender of the person and play a targeted video ad based on these attributes.
- The video ads are stored in separate folders based on gender and age. Make sure to organize your video ads accordingly in the
Male
andFemale
folders, each containing subfolders for different age groups (e.g.,(0-2)
,(4-6)
, etc.). - If a video file is not found or if no face is detected, appropriate messages will be displayed in the application window.
If you want a complete Windows app with this script implemented, please visit: https://github.com/Abdullah-129/Ads_by_using_Face_detection
Contributions to this project are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
This project is licensed under the MIT License.
- The age and gender prediction models are based on the work of Gil Levi and Tal Hassner.
- The face detection model is based on the work of OpenCV.