Giter Club home page Giter Club logo

gender-image-classifier's Introduction

Gender-Image-Classifier

Uses Keras with a TensorFlow Backend to classify facial photos as male or female.

To use this to create your own model you would do a few steps:

  • Download lots of facial images - I used the LFW dataset: http://vis-www.cs.umass.edu/lfw/

  • run the image_classifier.py script

    • This will write your model to a JSON file and the weights for your model to an h5 file.

This can be used to classify images by:

  • Importing your model and load your weights

  • read images you'd like to classify into numpy array

  • Call the 'model.predict()' function on your numpy array representation of the image you'd like to classify.

An example of this can be found in the testing.py file.

gender-image-classifier's People

Contributors

baileyfriend avatar

Stargazers

xmlx avatar  avatar Apex avatar chenggui53 avatar  avatar  avatar

Watchers

James Cloos avatar  avatar

gender-image-classifier's Issues

Classifying age

Is it possible to classify the age as well or is there any dataset apart from imdb and adience to do so since both are inaccurate?

Test exception

Hi, I run testing.py but throw this exception:

Traceback (most recent call last):
  File "testing.py", line 35, in <module>
    prediction_b = model.predict(bailey)
  File "/usr/lib/python3.7/site-packages/keras/engine/training.py", line 1441, in predict
    x, _, _ = self._standardize_user_data(x)
  File "/usr/lib/python3.7/site-packages/keras/engine/training.py", line 579, in _standardize_user_data
    exception_prefix='input')
  File "/usr/lib/python3.7/site-packages/keras/engine/training_utils.py", line 135, in standardize_input_data
    'with shape ' + str(data_shape))
ValueError: Error when checking input: expected conv2d_1_input to have 4 dimensions, but got array with shape (1, 1)

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.