drsaikirant88
commited on
Commit
•
b055bcd
1
Parent(s):
e19d3ae
Update app.py
Browse files
app.py
CHANGED
@@ -246,7 +246,7 @@ def predict(img):
|
|
246 |
|
247 |
if len(faces) == 0:
|
248 |
|
249 |
-
img = img.resize(
|
250 |
|
251 |
pred_emotion, pred_emotion_idx, probs_emotion = learn_emotion.predict(array(grayscale(img)))
|
252 |
|
@@ -260,7 +260,7 @@ def predict(img):
|
|
260 |
else: # Max 3 for now
|
261 |
for face in faces[:3]:
|
262 |
|
263 |
-
img = face.resize((
|
264 |
|
265 |
pred_emotion, pred_emotion_idx, probs_emotion = learn_emotion.predict(array(grayscale(img)))
|
266 |
|
@@ -269,7 +269,7 @@ def predict(img):
|
|
269 |
emotions = {learn_emotion_labels[i]: float(probs_emotion[i]) for i in range(len(learn_emotion_labels))}
|
270 |
sentiments = {learn_sentiment_labels[i]: float(probs_sentiment[i]) for i in range(len(learn_sentiment_labels))}
|
271 |
|
272 |
-
output.append(img)
|
273 |
output.append(emotions)
|
274 |
output.append(sentiments)
|
275 |
|
|
|
246 |
|
247 |
if len(faces) == 0:
|
248 |
|
249 |
+
img = img.resize(48, 48)
|
250 |
|
251 |
pred_emotion, pred_emotion_idx, probs_emotion = learn_emotion.predict(array(grayscale(img)))
|
252 |
|
|
|
260 |
else: # Max 3 for now
|
261 |
for face in faces[:3]:
|
262 |
|
263 |
+
img = face.resize((48, 48))
|
264 |
|
265 |
pred_emotion, pred_emotion_idx, probs_emotion = learn_emotion.predict(array(grayscale(img)))
|
266 |
|
|
|
269 |
emotions = {learn_emotion_labels[i]: float(probs_emotion[i]) for i in range(len(learn_emotion_labels))}
|
270 |
sentiments = {learn_sentiment_labels[i]: float(probs_sentiment[i]) for i in range(len(learn_sentiment_labels))}
|
271 |
|
272 |
+
output.append(img.resize((12, 12)))
|
273 |
output.append(emotions)
|
274 |
output.append(sentiments)
|
275 |
|