FERModel

class fermodel.FERModel(target_emotions, verbose=False)[source]

Pretrained deep learning model for facial expression recognition.

Parameters:
  • target_emotions – set of target emotions to classify
  • verbose – if true, will print out extra process information

Example:

from fermodel import FERModel

target_emotions = ['happiness', 'disgust', 'surprise']
model = FERModel(target_emotions, verbose=True)
POSSIBLE_EMOTIONS = ['anger', 'fear', 'calm', 'sadness', 'happiness', 'surprise', 'disgust']
predict(image_file)[source]

Predicts discrete emotion for given image.

Parameters:images – image file (jpg or png format)