Giter Site home page Giter Site logo

danigy / resnet50-pytorch-face-recognition Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kaihuatang/resnet50-pytorch-face-recognition

0.0 1.0 0.0 853 KB

Using Pytorch to implement a ResNet50 for Cross-Age Face Recognition

License: MIT License

Python 100.00%

resnet50-pytorch-face-recognition's Introduction

ResNet-Pytorch-Face-Recognition

Using Pytorch to implement a ResNet50 for Cross-Age Face Recognition
Generally speaking, Pytorch is much more user-friendly than Tensorflow for academic purpose.

Prepare Dataset and Environment

Trainable ResNet50 using Python3.5 + Pytorch
DataSet: Cross-Age Celebrity Dataset(CACD)
By default, you should put all the CACD images under "./CACD2000/". If your dataset is in another place, add "--root-path your_path" when you run main.py.
You don't need to crop image into 2242243 size anymore, pytorchvision provide convenient "transforms" to do so.

Explanation of Each File

  1. main.py is just used to control parameters, it doesn't contains any useful details.
  2. ResNet.py & VGG.py are the cores of the project, they have the implementation of Networks.
  3. train.py contains the details of training process.
  4. data.py maintains a Class to generate CACD data class, which is very different with Tensorflow and quite useful.
  5. In /model/params.pkl, we give a pretrained model learnt through default setting (change number of epoch to 30)

Training Part

  1. Run main.py directly, there are some options and parameters you can modify, pleace check the details of main.py.
  2. About "--model", there are 3 options: resnet50, resnet101, vgg16. Although I also implemented VGG class, but I didn't check whether it's working or not, so the default option is resnet50.
  3. Labels and Image names are loaded from "./data/label.npy" and "./data/name.npy".
    Pytorch provide a very useful approach to create datasets. Please check data.py
  4. Label is range from [1, LABELSNUM], to make correct classification, we should change it to [0, LABELNUM-1]
  5. If you want to load a existing model, you should run the following "python main.py --model-path your_path --pretrained 1".

Evaluation

Since I just want to get used to Pytorch. I didn't prepare a evaluation method, you can make your own if you like.

resnet50-pytorch-face-recognition's People

Contributors

kaihuatang avatar

Watchers

James Cloos 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.