Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fyt3rp4til/age-prediction
https://github.com/fyt3rp4til/age-prediction
caffemodel cmake dlib-face-detection opencv tensorflow
Last synced: 3 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/fyt3rp4til/age-prediction
- Owner: FYT3RP4TIL
- License: mit
- Created: 2023-09-29T12:19:38.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-02T05:19:28.000Z (12 months ago)
- Last Synced: 2024-01-18T20:16:55.352Z (10 months ago)
- Topics: caffemodel, cmake, dlib-face-detection, opencv, tensorflow
- Language: Jupyter Notebook
- Homepage:
- Size: 95.1 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Age-Detection
Objective :
To build a gender and age detector that can approximately guess the gender and age of the person (face) in a picture or through webcam.
About the Project :
In this Python Project, I had used Deep Learning to accurately identify the gender and age of a person from a single image of a face. I used the models trained by Tal Hassner and Gil Levi. The predicted gender may be one of ‘Male’ and ‘Female’, and the predicted age may be one of the following ranges- (0 – 2), (4 – 6), (8 – 12), (15 – 20), (25 – 32), (38 – 43), (48 – 53), (60 – 100) (8 nodes in the final softmax layer). It is very difficult to accurately guess an exact age from a single image because of factors like makeup, lighting, obstructions, and facial expressions.
📁Dataset :
For this python project, I had used the Adience dataset; the dataset is available in the public domain and you can find it here. This dataset serves as a benchmark for face photos and is inclusive of various real-world imaging conditions like noise, lighting, pose, and appearance. The images have been collected from Flickr albums and distributed under the Creative Commons (CC) license. It has a total of 26,580 photos of 2,284 subjects in eight age ranges (as mentioned above) and is about 1GB in size. The models I used had been trained on this dataset.
🔑Additional Python Libraries Required :
- OpenCV
pip install opencv-python
- cmake
pip install cmake
- dlib
pip install dlib
For face detection, we have a .pb file- this is a protobuf file (protocol buffer); it holds the graph definition and the trained weights of the model. We can use this to run the trained model. And while a .pb file holds the protobuf in binary format, one with the .pbtxt extension holds it in text format. These are TensorFlow files. For age and gender, the .prototxt files describe the network configuration and the .caffemodel file defines the internal states of the parameters of the layers.
🔑Workflow :
💡Usage :
- Download the Repository
- Open the notebook OpenCV_dlib_code.
- Change the image name :
img = cv2.imread('sample.jpg')
Note: The Image should be present in same folder where all the files are present
- Run the code.
Examples :