add the best model #1

Merged
s444391 merged 1 commits from final-model into master 2023-02-01 17:27:43 +01:00
5 changed files with 20 additions and 17 deletions

View File

@ -7,6 +7,7 @@ The goal of the project is to create a system that recognizes emotions in real t
## Start system
- unpack input.zip file
- <code> pip install -r < requirements.txt <code>>
- <code>python project.py</code>
## Train and use model

BIN
input.zip

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -27,22 +27,11 @@ while True:
pred = loaded_model.predict(roi[np.newaxis, :, :, np.newaxis])
text_idx=np.argmax(pred)
text_list = ['Angry', 'Disgust', 'Fear', 'Happy', 'Neutral', 'Sad', 'Surprise']
if text_idx == 0:
text= text_list[0]
if text_idx == 1:
text= text_list[1]
elif text_idx == 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)
try:
text = text_list[text_idx]
except:
text = 'err'
cv2.putText(img, text, (x, y-5), cv2.FONT_HERSHEY_SIMPLEX, 2.5, (255, 0, 255), 2)
img = cv2.rectangle(img, (x,y), (x+w, y+h), (0,0,255), 2)

13
requirements.txt Normal file
View 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