From 7310cb9df67cecd100186a144be103210116d76a Mon Sep 17 00:00:00 2001 From: Vaek <timothe.boulet@student-cs.fr> Date: Fri, 26 Mar 2021 00:18:43 +0100 Subject: [PATCH] example on a face --- __pycache__/config.cpython-38.pyc | Bin 0 -> 285 bytes __pycache__/faceAnalysis.cpython-38.pyc | Bin 638 -> 577 bytes config.py | 8 ++++++++ faceAnalysis.py | 3 +-- imageProcess.py | 1 - loadFer2013ds.py | 8 -------- 6 files changed, 9 insertions(+), 11 deletions(-) create mode 100644 __pycache__/config.cpython-38.pyc diff --git a/__pycache__/config.cpython-38.pyc b/__pycache__/config.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..73027f19325ace3f6094e5acd6f794ea3c21d0ea GIT binary patch literal 285 zcmWIL<>g{vU|<mBj!n45z`*br#6iaF3=9ko3=9m#atsU%DGX5zDU2yhDa<J>DXb}M zDeUR&QH&`ZQA{bE!3>&Qx46<Wi;7Ep^HWlDqF5dC(u*pi*j+M<(@Tp>qFCHg6N{o) zJrWBFDx;W#6H}ttgG&pFGK*8A*!@yVONtV6G?`x-FfcF_F)=VOykulxVDQsqj^fM( z8RwUnn|g~QH8;N`Ge58R7I$V|L1{^RaYkZ6>Pm(pHjpk5@yo>7DkiizwWv6zBr`X^ zBql8}IWsXwH?^XmD7CmaGe1u^CAB0q8DvUKa(-S~X1ZQM<t+}I-29Z%oK!oI&BZJX K3=AyHLd*c8KTU)H literal 0 HcmV?d00001 diff --git a/__pycache__/faceAnalysis.cpython-38.pyc b/__pycache__/faceAnalysis.cpython-38.pyc index 9e98b6702b934e5048221bfedb7773e89133c1ea..3180ef60e71d091d23f1159f4c5339bad92d61a8 100644 GIT binary patch delta 328 zcmeyza*#zkl$V!_fq{WRgDW=SD<cELV-N=!GchnQI503U6x&SHR&iuVVa{RAWs73V zWshQKWJqC2VQpcE;z(f(X3%7N3DW1M$#{!VOOxpqM`~_<NoIat@h$Gmyn@n__~MMj zg4BtJN?40n7#J8PJ2UFD7BPcZHH;>rAV>VNa<+;IElw>ejw#8^%`b_We3DVRJ|-<O zIn^;QF{iRPvska7@)mDOYDsExi7Ui-4v^b;KsK{*G4U{RF>*0-FcyIXG&ze{85kID zvF4TL7E~6of!NH+Wk$DHOG`3yilf+)^YhX&)4^^4I|;0-2;>qZLXjJ!kHaQ6KczG$ R)eaOK#ULddj1VZm1OUIQNX7sF delta 406 zcmX@e@{dJ3l$V!_fq{X+turRUn2CYmF^GeV*%=rZ92giFik&8EtJE{6u%xi2u%)o4 zaHMdivq!O}a7D4DaHsIJFhsGZFa|Sd^1cM=_S0m%#i$j<>X?^aR2jwYl3AQyT3iyv z;+C3N6vgV1SWr+I#T=ZN62%@|T2Pc(oEpXMms(m<l$fK*{L+AdfuV?*fq~&ABLf3N zGKc_~$-uxcaZU#BE$+;`g3^-s;*7+C)XAKT`dqg-Qgic5GV}9_C)+ZbgzzvhF#NL9 z&&?~*Pu34DPAw|dFUic!FVRm+OwLTq(M_!=C`v6Z&dkr#O-U_DO$O-%$)!5xCFWEX zXBO)fRNmr+NV!4`=A3+xQ8bm0fq_Ajqlk@xf#DWwUTJPYWf3TJZZRj98Qo$nEy>I& rF5(2aofSlYR2PBVf<*9wv~t+w=BJeAq}nlof)%8KgAoFS7+IJAh?8ZD diff --git a/config.py b/config.py index e69de29..501e274 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 0dd26b2..107d9bc 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 9da3637..a8b4be6 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 65d991a..1818992 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) -- GitLab