Skip to content

pytorch implementation of gender classification and real-time gender classification

Notifications You must be signed in to change notification settings

KeyuLi/GenderClassification

Repository files navigation

GenderClassification

We provide a Pytorch implementation of gender classification, you can achieve gender classification based on photo or video, and also you can use your computer camera to achieve it.

Requirement

  • Ubuntu or Windows
  • Python3
  • NVIDIA GPU + CUDA CuDNN

Getting Started

To use the real-time gender classification, run realtime.py To get the gender classification based on photo, run photo.py --input_photo_path --output_photo_path To get the gender classification based on video, run video.py --input_video_path --output_video_path

Details

  • The pre-trained model we used in realtime.py is based on AlexNet, and the model we used in photo.pyis based on ResNet, if you want to train your model, you can run the genderClassifyRes.py
  • In realtime.py and video.py, we use the mtcnn to detect the face, it can get a great result in dynamic video. And in
    photo.py, we use the face detector in Opencv. You can replace it accord to the actual effect.

Dataset

You can Download CelebA dataset from here.

Related Projects

mtcnn.

Results

  • The result of gender classification based on photo: image1 image2 image3

  • The result of gender classification based on video: image4

About

pytorch implementation of gender classification and real-time gender classification

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published