Select Git revision
variables.index
Forked from
Automatants / Facial expression detection
Source project has a limited visibility.
faceAnalysis.py NaN GiB
#Objective of this file is to analyse a face
import keras
import numpy as np
import cv2
from utils import *
emotions = ["Angry", "Disgust", "Fear", "Happy", "Sad", "Suprise", "Neutral"]
input_shape = (48,48,1)
def detectEmotion(face):
#Return the most likely emotion there is on a 48x48x1 gray face
#input = 48
face = normAndResize(face, input_shape)
model = keras.models.load_model('firstModel') #Load our model
emotionVect = predir(model, face)
emotionNbr = np.argmax(emotionVect)
emotion = emotions[emotionNbr]
return emotion