serengil / deepface

A Lightweight Face Recognition and Facial Attribute Analysis (Age, Gender, Emotion and Race) Library for Python
https://bit.ly/deepface-py
MIT License
14.8k stars 2.24k forks source link

reduced model for emotion detection #114

Closed NiloofarMn closed 4 years ago

NiloofarMn commented 4 years ago

Hello and thank you for this great library.

I was wondering if there is a way to reduce choices for facial expressions when detecting it with Deepface.analyze() As I know, the more expressions there are, the more probable for the result to be wrong. So I need something more accurate. Is there any way or any model which works with fewer emotions available?

serengil commented 4 years ago

this can be handled in post-processing step. Alternatively, you can group some emotions and retrain the model from scratch. Pre-trained weights are stored in HOME/.deepface/weights/ folder and emotion's model is facial_expression_model_weights.h5 file. You can modify this weight file.