Skip to content
Snippets Groups Projects
Select Git revision
  • ed1759c91e1a4cd3529edb4e5dcfe59d15abd6e6
  • master default
  • feat/pull_changes
3 results

App.js

Blame
  • 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