diff --git a/__pycache__/config.cpython-38.pyc b/__pycache__/config.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..73027f19325ace3f6094e5acd6f794ea3c21d0ea Binary files /dev/null and b/__pycache__/config.cpython-38.pyc differ diff --git a/__pycache__/faceAnalysis.cpython-38.pyc b/__pycache__/faceAnalysis.cpython-38.pyc index 9e98b6702b934e5048221bfedb7773e89133c1ea..3180ef60e71d091d23f1159f4c5339bad92d61a8 100644 Binary files a/__pycache__/faceAnalysis.cpython-38.pyc and b/__pycache__/faceAnalysis.cpython-38.pyc differ diff --git a/config.py b/config.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..501e27405619b029250040ed52590fa2643279f2 100644 --- a/config.py +++ b/config.py @@ -0,0 +1,8 @@ +#Name of model used +modelName = 'firstModel' + +#Emotions provided by the dataset +emotions = ["Angry", "Disgust", "Fear", "Happy", "Sad", "Suprise", "Neutral"] + +#Shape of input of the model +input_shape = (48,48,1) \ No newline at end of file diff --git a/faceAnalysis.py b/faceAnalysis.py index 0dd26b246d783ab02956def12c92c353b0c4c1be..107d9bc9d0247b7583cbae2a518b54980d361f79 100644 --- a/faceAnalysis.py +++ b/faceAnalysis.py @@ -3,8 +3,7 @@ import keras import numpy as np import cv2 from utils import * -emotions = ["Angry", "Disgust", "Fear", "Happy", "Sad", "Suprise", "Neutral"] -input_shape = (48,48,1) +from config import emotions, input_shape def detectEmotion(face): #Return the most likely emotion there is on a 48x48x1 gray face diff --git a/imageProcess.py b/imageProcess.py index 9da3637b04e6fde8320c11cb89853c80a24e0152..a8b4be6c44677402604ba168963a1c8bae7b0de9 100644 --- a/imageProcess.py +++ b/imageProcess.py @@ -2,7 +2,6 @@ import cv2 import numpy as np import faceAnalysis as fa -input_shape = (48,48,1) def imageProcess(image): #Objectives : detect faces, identify emotion associated on it, modify the image by framing faces and writing their emotions associated diff --git a/loadFer2013ds.py b/loadFer2013ds.py index 65d991a33dae5d30a5deb48ece4ba6f4978f2a37..18189926ac7470df269dd1d366c7196237191434 100644 --- a/loadFer2013ds.py +++ b/loadFer2013ds.py @@ -9,14 +9,6 @@ nbrImages = 35887 maxNbrImages = nbrImages emotions = ["Angry", "Disgust", "Fear", "Happy", "Sad", "Suprise", "Neutral"] -def traitement(a,b,c): #For testing - pass - # arr = strToArray(b) - # print(a) - # plt.imshow(arr) - # plt.show() - # pass - def strToArray(string): #Fer2013 provides images as string so it needs to be transformed A = [] lenght = len(string)