"Beauty is in the eye of the beholder" as the saying goes. Well now that task has been automated as well.
Beholder is a neural network trained to rate faces in images. The network was trained using the rated image data provided by South China University of Technology.
The following python packages are required:
* keras
* matplotlib
* opencv
* pillow
* pydot
* tensorboard
Training the network is a two-stage process.
-
First the last few layers need to be trained. The MobileNet weights are held constant, while only the new layers are mutable.
python train.pyThe final weights are stored in train.h5.
Checkpoints occur at each epoch and are stored in the files train.{epoch}-{loss}.hdf5.
Information is also stored for Tensorboard in the logs/train directory.
-
Then the full network is fine tuned and all weights are mutable.
python fine-tune.pyThe final weights are stored in fine-tune.h5.
Like training, checkpoints occur at each epoch and are stored in the files fine-tune.{epoch}-{loss}.hdf5.
Tensorboard information is stored in the logs/fine-tune directory.
-
Tensorboard may be used to visualize training statistics.
tensorboards --logdir logs
To view rating information on photos run:
python test.py <file1.jpg> [file2.jpg file3.jpg ...]
All detected faces will be highlighted in rectangles with the associated rating.
The paper can be found here: paper/paper.pdf.
