Spaces:
Sleeping
Sleeping
Commit
·
e8a8549
1
Parent(s):
d37afb5
Update app.py
Browse files
app.py
CHANGED
@@ -4,11 +4,8 @@ from botocore.exceptions import BotoCoreError, ClientError
|
|
4 |
from PIL import Image
|
5 |
import numpy as np
|
6 |
import io
|
7 |
-
import pyttsx3
|
8 |
import time
|
9 |
import os
|
10 |
-
import subprocess
|
11 |
-
from gtts import gTTS#
|
12 |
|
13 |
aws_key_id = os.environ['aws_access_key_id']
|
14 |
aws_secret = os.environ['aws_secret_access_key']#
|
@@ -22,12 +19,6 @@ try:
|
|
22 |
except (BotoCoreError, ClientError) as error:
|
23 |
print('Error: ', error)#
|
24 |
|
25 |
-
def text_to_speech(text):
|
26 |
-
tts = gTTS(text=text)
|
27 |
-
audio = io.BytesIO()
|
28 |
-
tts.write_to_fp(audio)
|
29 |
-
audio.seek(0)
|
30 |
-
return text, audio.read()#
|
31 |
|
32 |
def recognize_emotions(image):
|
33 |
"""
|
@@ -70,7 +61,7 @@ def recognize_emotions(image):
|
|
70 |
# Create Gradio interface
|
71 |
iface = gr.Interface(recognize_emotions,
|
72 |
inputs=gr.Image(source="webcam", streaming=True),
|
73 |
-
outputs=["text"
|
74 |
title="How does this person feel?",
|
75 |
description="Helping you understand what others think")#
|
76 |
# Launch the interface
|
|
|
4 |
from PIL import Image
|
5 |
import numpy as np
|
6 |
import io
|
|
|
7 |
import time
|
8 |
import os
|
|
|
|
|
9 |
|
10 |
aws_key_id = os.environ['aws_access_key_id']
|
11 |
aws_secret = os.environ['aws_secret_access_key']#
|
|
|
19 |
except (BotoCoreError, ClientError) as error:
|
20 |
print('Error: ', error)#
|
21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
|
23 |
def recognize_emotions(image):
|
24 |
"""
|
|
|
61 |
# Create Gradio interface
|
62 |
iface = gr.Interface(recognize_emotions,
|
63 |
inputs=gr.Image(source="webcam", streaming=True),
|
64 |
+
outputs=["text"],
|
65 |
title="How does this person feel?",
|
66 |
description="Helping you understand what others think")#
|
67 |
# Launch the interface
|