The app will detect the face and draw a bounding box around it. It will then predict the person’s approximate age range and gender (male/female). The application combines live face detection with demographic prediction: it can run on a webcam stream or on uploaded images, drawing bounding boxes around detected faces and overlaying age/gender labels with confidence bars. Similar projects use pre-trained models for these tasks, for example noting that they “utilize pre-trained deep learning models to detect faces, estimate age, and classify gender”. Key features include:
rizvandwiki/gender-classification) predicts each face’s gender (male or female) in real time.nateraw/vit-age-classifier) predicts the face’s age group (an approximate age range).streamlit-webrtc) or uploading static images for analysis. The user can switch between these modes in the interface.nateraw/vit-age-classifierrizvandwiki/gender-classification| Layer | Tool/Library |
|---|---|
| UI | Streamlit |
| Webcam | streamlit-webrtc |
| Models | Hugging Face Transformers |
| Age Model | nateraw/vit-age-classifier |
| Gender Model | rizvandwiki/gender-classification |
| Face Detection | OpenCV Haar cascades |
git clone https://github.com/your-username/real-time-age-gender-detection.git
cd real-time-age-gender-detection
python3 -m venv venv
source venv/bin/activate # On Windows use: venv\Scripts\activate
<span>requirements.txt</span>:
pip install -r requirements.txt
real-time-age-gender-detection/
├── app.py # Main Streamlit app (UI + logic)
├── detector.py # Face detection and prediction logic
├── utils.py # Helper functions
├── requirements.txt # Dependencies
├── README.md # This file
├── LICENSE # MIT License
├── models/ # (Optional) Cached models
├── assets/ # Images or icons for UI
├── pages/ # Optional: Additional Streamlit pages
└── .streamlit/ # Streamlit config
streamlit run app.py
You can deploy this app on:
If deploying on Streamlit Cloud, be sure to:
streamlit-webrtc to requirements.txt.streamlit/secrets.toml if using Hugging Face API tokens (for private models)Contributions, issues, and suggestions are welcome! Feel free to open a pull request or contact me.
The app will detect the face and draw a bounding box around it. It will then predict the person’s approximate age range and gender (male/female). The application combines live face detection with demographic prediction: it can run on a webcam stream or on uploaded images, drawing bounding boxes around detected faces and overlaying age/gender labels with confidence bars. Similar projects use pre-trained models for these tasks, for example noting that they “utilize pre-trained deep learning models to detect faces, estimate age, and classify gender”. Key features include:
rizvandwiki/gender-classification) predicts each face’s gender (male or female) in real time.nateraw/vit-age-classifier) predicts the face’s age group (an approximate age range).streamlit-webrtc) or uploading static images for analysis. The user can switch between these modes in the interface.nateraw/vit-age-classifierrizvandwiki/gender-classification| Layer | Tool/Library |
|---|---|
| UI | Streamlit |
| Webcam | streamlit-webrtc |
| Models | Hugging Face Transformers |
| Age Model | nateraw/vit-age-classifier |
| Gender Model | rizvandwiki/gender-classification |
| Face Detection | OpenCV Haar cascades |
git clone https://github.com/your-username/real-time-age-gender-detection.git
cd real-time-age-gender-detection
python3 -m venv venv
source venv/bin/activate # On Windows use: venv\Scripts\activate
<span>requirements.txt</span>:
pip install -r requirements.txt
real-time-age-gender-detection/
├── app.py # Main Streamlit app (UI + logic)
├── detector.py # Face detection and prediction logic
├── utils.py # Helper functions
├── requirements.txt # Dependencies
├── README.md # This file
├── LICENSE # MIT License
├── models/ # (Optional) Cached models
├── assets/ # Images or icons for UI
├── pages/ # Optional: Additional Streamlit pages
└── .streamlit/ # Streamlit config
streamlit run app.py
You can deploy this app on:
If deploying on Streamlit Cloud, be sure to:
streamlit-webrtc to requirements.txt.streamlit/secrets.toml if using Hugging Face API tokens (for private models)Contributions, issues, and suggestions are welcome! Feel free to open a pull request or contact me.