Skip to content

This project demonstrates real-time age and gender detection using OpenCV and deep learning models. The application captures video from the default camera and detects faces in the frames using an OpenCV face detection model.

License

Notifications You must be signed in to change notification settings

Abdullah-129/InstantInsight-AI-Age-Gender-Recognition

Repository files navigation

<title>Real-Time Age and Gender Detection</title>

Real-Time Age and Gender Detection with Video Ads

Project Screenshot

🚀 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.

✨ Features

  • 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

🛠️ Requirements

  • 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

⚙️ Installation

  1. Clone the repository:
    git clone https://github.com/Abdullah-129/InstantInsight-AI-Age-Gender-Recognition.git
  2. Install the required dependencies:
    pip install -r requirements.txt
  3. 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
  4. Place the downloaded model files in the project directory.

▶️ Usage

  1. Run the following command to start the application:
    python main.py
  2. The application will open a window displaying the live camera feed.
  3. 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.
  4. The video ads are stored in separate folders based on gender and age. Make sure to organize your video ads accordingly in the Male and Female folders, each containing subfolders for different age groups (e.g., (0-2), (4-6), etc.).
  5. If a video file is not found or if no face is detected, appropriate messages will be displayed in the application window.

🌟 Complete Windows App

If you want a complete Windows app with this script implemented, please visit: https://github.com/Abdullah-129/Ads_by_using_Face_detection

🤝 Contributing

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.

📄 License

This project is licensed under the MIT License.

🙏 Acknowledgments

🔗 References

About

This project demonstrates real-time age and gender detection using OpenCV and deep learning models. The application captures video from the default camera and detects faces in the frames using an OpenCV face detection model.

Topics

Resources

License

Stars

Watchers

Forks

Languages