Coder Social home page Coder Social logo

metric_learning's Introduction

metric_learning

Metric Learning TF 2.0+Keras Algorithm Implementations for Facial Recognition

Requirements:

  1. Python 3.6+
  2. pip install -r requirements.txt
  3. If GPU is available, pip install tensorflow-gpu==2.0.0 (highly recommended)

Datset setup:

These steps will download the VGGFace2 dataset (caution: ~40GB of disk space is required)

  1. Create an account at http://zeus.robots.ox.ac.uk/vgg_face2/login/
  2. Run the dataset download scripts (metric_learning/utils/vggface2_train_download.py and metric_learning/utils/vggface2_test_download.py)
  3. Unzip the resutling "vggface2_train.tar.gz" and "vggface2_test.tar.gz" files into the metric_learning/data directory
  4. Run python utils/create_dataset.py in order to create "vggface2_train_dataset" and "vggface2_test_dataset" directories of preprocessed images

Pretrain softmax model on vggface2_train_dataset (preprocessed VGG2Face train set):

These are the steps to pretrain a softmax loss-based model on the preprocessed "train_dataset"

  1. cd metric_learning
  2. python pretrain_softmax_model.py

Finetune softmax model using metric learning on vggface2_test_dataset (preprocessed VGG2Face test set):

These are the steps to finetune a pretrained model using a metric learning and the preprocessed "test_dataset"

  1. cd metric_learning
  2. python finetune_softmax_model.py -m ["softmax", "contrastive", "triplet", "lmcl", "aaml"]

metric_learning's People

Contributors

phillity 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.