<commit_before># Training new models
This repository also contains our training infrastructure to promote an
open ecosystem and enable quicker bootstrapping for new research and development.
Warning: Training is computationally and memory expensive and takes a
few weeks on our Tesla K40 GPU.
Because of this, the training code assumes CUDA is installed.

A rough overview of training is:

## 1. Create raw image directory.
Create a directory for your raw images so that images from different
people are in different subdirectories. The names of the labels or
images do not matter, and each person can have a different amount of images.
The images should be formatted as `jpg` or `png` and have
a lowercase extension.

```
$ tree data/mydataset/raw
person-1
├── image-1.jpg
├── image-2.png
...<commit_msg>Add note to training new models.<commit_after># Training new neural network models

We have also released our training infrastructure to promote an
open ecosystem and enable quicker bootstrapping for new research and development.

The deep neural network (DNN) model produces the feature representation
of faces.
We provide pre-trained models trained with about 500k images that
can be used to train new face classifiers as shown in
[Demo 3](http://cmusatyalab.github.io/openface/demo-3-classifier/).
Training a new DNN model is for advanced users and should be done
with large datasets (>500k images) to improve the feature representation.

Warning: Training is computationally and memory expensive and takes a
few weeks on our Tesla K40 GPU.
Because of this, the training code assumes CUDA is installed.

A rough overview of training is:

## 1. Create raw image directory.
Create a directory for your raw images so that images from different
people are in different subdirectories. The names of the labels or
images do not matter, and each person can have a different amount of images.
The images should be formatted as `jpg` or `png` and have
a lowercase extension.

```
$ tree data/mydataset/raw
person-1
├── image-1.jpg
├── image-2.png
...
{'fraction_non_alphanumeric': 0.0527086383601757, 'fraction_numerical': 0.009760858955588092, 'mean_word_length': 4.49597855227882, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6482350', 'n_tokens_mistral': 529, 'n_tokens_neox': 504, 'n_words': 307}