DLEC is a convolutional neural network that classifies images of human facial expressions in emotions.
It can be used as a framework for developing general purpose deep learning classifiers.
This is a final year project to achieve the Bachelor degree in Computer Science Lutheran University of Brazil.
Accomplish researches on deep learning and develop a model capable to classify human emotions in images.
train.py
- Set the
train_dataset
path - Set the
validation_dataset
path (if empty, the train dataset will be slited into train and validation) - Set
image_width
andimage_height
- Set
learning_rate
,test_size
(only used whenvalidation_dataset
isNone
),batch_size
andepochs
cnn.py
- Define the architecture of the CNN in the function
get_network_architecture
- Use the inline documentation as reference
predict.py
- Set the same
image_width
andimage_height
as intrain.py
- Make sure the images exist under the paths set in
train_dataset
andvalidation_dataset
- The images of each class should be in its own directory. See the configuration below:
Datasets / \ Train Validation / \ Class 1, Class 1, Class 2, Class 2, ..., ..., Class n, Class n,
- Run the training with the command
python train.py
- The training status will be outputed during training
- Run
python predict.py
to get help on the available prediction methods
- Examples:
python predict.py 1 /Datasets/Test/
(evaluates the model)python predict.py 6
(real time predictions using the embedded camera)python predict.py <TASK> <PATH>
(general case)
- Option 1 does not require the task specification. The command
python predict.py <PATH>
will run into task 1 - Option 6 does not need any path, since it will use the embedded camera as source
- The code is runnable both in Python 2 and Python 3
- The code also works on Windows (it was tested on Windows 10). Keep in mind adjustments might be required for your environment.
Maikel Maciel Rönnau
Computer Scientist
maikel.ronnau@gmail.com
Linkedin - GitHub