Skip to content
Snippets Groups Projects
Select Git revision
  • 9f776cffb3460fd9da8c5e9a54b921df35ddeab8
  • master default
  • autorisation_visit
  • signup_mydata
  • format_editData
  • dev
  • authorize-valid-profile
  • feli90-patch-2
  • feli90-patch-1
  • context_sheet
  • testNewForm
  • FeliLocalTest1
  • ios-account-fix
  • change-form-link
  • dev_pages_projet
  • remise_sorties
  • release/first-users
17 results

index.ts

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