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

debug

parents fda87efa b2a35e34
No related branches found
No related tags found
No related merge requests found
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
Source diff could not be displayed: it is too large. Options to address this: view the blob.
...@@ -5,7 +5,9 @@ import cv2 ...@@ -5,7 +5,9 @@ import cv2
from utils import * from utils import *
from config import emotions, input_shape, modelName from config import emotions, input_shape, modelName
model = keras.models.load_model("models/"+modelName) #Load our model #model = tf.keras.models.load_model("models/"+modelName) #Load our model
model = tf.saved_model.load("models/"+modelName)
print('Model used:', modelName) print('Model used:', modelName)
def detectEmotion(face): def detectEmotion(face):
......
...@@ -17,11 +17,6 @@ def smileyRandom(emotionToDodge): ...@@ -17,11 +17,6 @@ def smileyRandom(emotionToDodge):
smiley = cv2.imread(smileyImagePath) smiley = cv2.imread(smileyImagePath)
return smiley, emotion return smiley, emotion
ismain = __name__ == "__main__"
if ismain:
smiley, emotion = smileyRandom("") smiley, emotion = smileyRandom("")
while cap.isOpened(): #or while 1. cap.isOpened() is false if there is a problem while cap.isOpened(): #or while 1. cap.isOpened() is false if there is a problem
......
...@@ -18,8 +18,8 @@ def afficher(image): ...@@ -18,8 +18,8 @@ def afficher(image):
def predir(modele, image): def predir(modele, image):
# Return output of image from modele # Return output of image from modele
return modele.predict(np.array([image]))[0, :] #return modele.predict(np.array([image]))[0, :]
return modele(np.array([image]))[0, :]
def normAndResize(image, input_shape): def normAndResize(image, input_shape):
# For an array image of shape (a,b,c) or (a,b), transform it into (h,l,p). Also normalize it. # For an array image of shape (a,b,c) or (a,b), transform it into (h,l,p). Also normalize it.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment