Skip to content

OliverEdholm/VGG-Face-Logistic-Regression

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VGG-Face-Logistic-Regression

Classifying images of faces using the same technique this paper used: https://psyarxiv.com/hv28a/

How it works

This program takes an embedding from a pretrained VGG Face model, then applies PCA or Truncated SVD on it and at last doing Logistic Regression.

Requirements

To install: pip3 install -r requirements.txt

  • Python 3.*
  • Tensorflow
  • Sklearn
  • CV2
  • Keras
  • Keras VGG Face
  • tqdm
  • Numpy
  • Six

Adjusting parameters

Before you create your dataset file and train your model it's adviseable that you adjust the parameters first. This you can do by editing the file config.py. If you don't understand a parameter it's best to leave it alone.

When running a script you can always pass the parameters directly and override the config.py parameters. To get to know what the parameters are you can type python3 script_name.py -h.

Dataset

There's a dataset in the data folder with images of faces from men and women.

To use your own dataset you can look at the file data/data.json and copy the same format.

Training

It's as easy as running the script python3 training.py

Testing

It's as easy as running the script python3 test_model.py --img_path=image.jpg

Todos

  • Other ML techniques instead of Logistic Regression.

Other

Made by Oliver Edholm, 15 years old.