Git Product home page Git Product logo

age_gender_detection_project's Introduction

Age_Gender_Detection

This project is all about detecing age and gender of the human face based on UTKFace collection Where approx on 23000 images computaion is performed .
So Project File and dataset is attached in this repository

Contributors :
Sourabh Agarwal
Shailesh Goyal

Dataset-https://susanqq.github.io/UTKFace/
UTKFace dataset is a large-scale face dataset with long age span, which ranges from 0 to 116 years old. The images cover large variation in pose, facial
expression, illumination, occlusion, resolution and other such.

Size: The dataset consists of over 20K images with annotations of age, gender and ethnicity.

Projects: The dataset can be used on a variety of task such as facial detection, age estimation, age progression, age regression, landmark localisation, etc.

################################# import cv2
images = []
ages = []
genders = []
for file in files:
image = cv2.imread(path+file,0)
image = cv2.resize(image,dsize=(64,64))
image = image.reshape((image.shape[0],image.shape[1],1))
images.append(image)
split_var = file.split('_')
ages.append(split_var[0])
genders.append(int(split_var[1]))
#################################### In this part of code I just change the size of the image so that we all can have same size of image this will help in compuation

#################################### def display(img):
plt.imshow(img[:,:,0])
plt.set_cmap('gray')
plt.show()
idx = 500
sample = images[idx]
print("Gender:",genders[idx],"Age:",ages[idx])
display(sample)
#################################### Performing some data analysis in this part of code based on the age factor
Now later on we will predict on some image using CNN

Model: "functional_1"


Layer (type) Output Shape Param # Connected to

input_1 (InputLayer) [(None, 64, 64, 1)] 0


conv2d (Conv2D) (None, 62, 62, 32) 320 input_1[0][0]


conv2d_1 (Conv2D) (None, 60, 60, 64) 18496 conv2d[0][0]


max_pooling2d (MaxPooling2D) (None, 30, 30, 64) 0 conv2d_1[0][0]


conv2d_2 (Conv2D) (None, 28, 28, 128) 73856 max_pooling2d[0][0]


max_pooling2d_1 (MaxPooling2D) (None, 14, 14, 128) 0 conv2d_2[0][0]


dropout (Dropout) (None, 14, 14, 128) 0 max_pooling2d_1[0][0]


flatten (Flatten) (None, 25088) 0 dropout[0][0]


dense_4 (Dense) (None, 128) 3211392 flatten[0][0]


dropout_2 (Dropout) multiple 0 dense_4[0][0]
dense_5[0][0]
dense_6[0][0]
dense_7[0][0]
dense_8[0][0]


dense_5 (Dense) (None, 64) 8256 dropout_2[0][0]


dense (Dense) (None, 128) 3211392 flatten[0][0]


dense_6 (Dense) (None, 32) 2080 dropout_2[1][0]


dropout_1 (Dropout) multiple 0 dense[0][0]
dense_1[0][0]
dense_2[0][0]


dense_1 (Dense) (None, 64) 8256 dropout_1[0][0]


dense_7 (Dense) (None, 16) 528 dropout_2[2][0]


dense_2 (Dense) (None, 32) 2080 dropout_1[1][0]


dense_8 (Dense) (None, 8) 136 dropout_2[3][0]


dense_3 (Dense) (None, 1) 33 dropout_1[2][0]


dense_9 (Dense) (None, 1) 9 dropout_2[4][0]

Total params: 6,536,834
Trainable params: 6,536,834
Non-trainable params: 0


#so after calling fit model we can finaaly fit our CNN network with the dataset
and after this we can finally predict what our output is

alt text

age_gender_detection_project's People

Contributors

agarwalsourabh55 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.