Skip to content
Snippets Groups Projects
Commit 72f9dd9d authored by Timothé Boulet's avatar Timothé Boulet :alien:
Browse files

commit

parent 7310cb9d
No related branches found
No related tags found
No related merge requests found
No preview for this file type
...@@ -3,15 +3,15 @@ import keras ...@@ -3,15 +3,15 @@ import keras
import numpy as np import numpy as np
import cv2 import cv2
from utils import * from utils import *
from config import emotions, input_shape from config import emotions, input_shape, modelName
def detectEmotion(face): def detectEmotion(face):
#Return the most likely emotion there is on a 48x48x1 gray face #Return the most likely emotion there is on a 48x48x1 gray face
#input = 48
face = normAndResize(face, input_shape) face = normAndResize(face, input_shape) #Process our image for input of model
model = keras.models.load_model(modelName) #Load our model
model = keras.models.load_model('firstModel') #Load our model
emotionVect = predir(model, face) emotionVect = predir(model, face)
emotionNbr = np.argmax(emotionVect) emotionNbr = np.argmax(emotionVect)
emotion = emotions[emotionNbr] emotion = emotions[emotionNbr]
......
...@@ -53,9 +53,9 @@ def selectFace(image): ...@@ -53,9 +53,9 @@ def selectFace(image):
face = image[y:y+h, x:x+w] face = image[y:y+h, x:x+w]
return face return face
image = cv2.imread("cagnol.jpg", 1) #Load Cagnol colored image # image = cv2.imread("cagnol.jpg", 1) #Load Cagnol colored image
imageProcess(image) # imageProcess(image)
cv2.imshow("Cagnol", image) # cv2.imshow("Cagnol", image)
cv2.waitKey(0) # cv2.waitKey(0)
cv2.destroyAllWindows() # cv2.destroyAllWindows()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment