add the best model #1
@ -7,6 +7,7 @@ The goal of the project is to create a system that recognizes emotions in real t
|
|||||||
## Start system
|
## Start system
|
||||||
|
|
||||||
- unpack input.zip file
|
- unpack input.zip file
|
||||||
|
- <code> pip install -r < requirements.txt <code>>
|
||||||
- <code>python project.py</code>
|
- <code>python project.py</code>
|
||||||
|
|
||||||
## Train and use model
|
## Train and use model
|
||||||
|
File diff suppressed because one or more lines are too long
21
project.py
21
project.py
@ -27,22 +27,11 @@ while True:
|
|||||||
pred = loaded_model.predict(roi[np.newaxis, :, :, np.newaxis])
|
pred = loaded_model.predict(roi[np.newaxis, :, :, np.newaxis])
|
||||||
text_idx=np.argmax(pred)
|
text_idx=np.argmax(pred)
|
||||||
text_list = ['Angry', 'Disgust', 'Fear', 'Happy', 'Neutral', 'Sad', 'Surprise']
|
text_list = ['Angry', 'Disgust', 'Fear', 'Happy', 'Neutral', 'Sad', 'Surprise']
|
||||||
if text_idx == 0:
|
try:
|
||||||
text= text_list[0]
|
text = text_list[text_idx]
|
||||||
if text_idx == 1:
|
except:
|
||||||
text= text_list[1]
|
text = 'err'
|
||||||
elif text_idx == 2:
|
cv2.putText(img, text, (x, y-5), cv2.FONT_HERSHEY_SIMPLEX, 2.5, (255, 0, 255), 2)
|
||||||
text= text_list[2]
|
|
||||||
elif text_idx == 3:
|
|
||||||
text= text_list[3]
|
|
||||||
elif text_idx == 4:
|
|
||||||
text= text_list[4]
|
|
||||||
elif text_idx == 5:
|
|
||||||
text= text_list[5]
|
|
||||||
elif text_idx == 6:
|
|
||||||
text= text_list[6]
|
|
||||||
cv2.putText(img, text, (x, y-5),
|
|
||||||
cv2.FONT_HERSHEY_SIMPLEX, 0.45, (255, 0, 255), 2)
|
|
||||||
img = cv2.rectangle(img, (x,y), (x+w, y+h), (0,0,255), 2)
|
img = cv2.rectangle(img, (x,y), (x+w, y+h), (0,0,255), 2)
|
||||||
|
|
||||||
|
|
||||||
|
13
requirements.txt
Normal file
13
requirements.txt
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
tensorflow-addons==0.16.1
|
||||||
|
tensorflow-datasets==4.6.0
|
||||||
|
tensorflow-estimator==2.10.0
|
||||||
|
tensorflow==2.11.0
|
||||||
|
tensorflow-metadata==1.10.0
|
||||||
|
opencv-contrib-python==4.5.5.62
|
||||||
|
numpy==1.23.3
|
||||||
|
matplotlib==3.6.0
|
||||||
|
matplotlib-inline==0.1.6
|
||||||
|
pandas==1.5.2
|
||||||
|
kaggle==1.5.12
|
||||||
|
keras==2.10.0
|
||||||
|
Keras-Preprocessing==1.1.2
|
Loading…
Reference in New Issue
Block a user