Justin Shenk has built a library called Face Emotion Recognizer (FER) in Python that one can use to detect facial emotions.