Update app.py
Browse files
app.py
CHANGED
|
@@ -53,14 +53,22 @@ def get_predictions(audio_input):
|
|
| 53 |
|
| 54 |
###
|
| 55 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
# Define a function to generate an image using DeepAI Text to Image API
|
| 57 |
-
def generate_image(api_key,
|
| 58 |
url = "https://api.deepai.org/api/text2img"
|
| 59 |
headers = {'api-key': api_key}
|
| 60 |
response = requests.post(
|
| 61 |
url,
|
| 62 |
data={
|
| 63 |
-
'text':
|
| 64 |
},
|
| 65 |
headers=headers
|
| 66 |
)
|
|
|
|
| 53 |
|
| 54 |
###
|
| 55 |
|
| 56 |
+
# Define the API key for DeepAI Text to Image API
|
| 57 |
+
api_key = 'dee3e3f2-d5cf-474c-8072-bd6bea47e865'
|
| 58 |
+
|
| 59 |
+
# Generate the image with the transcribed text using DeepAI Text to Image API
|
| 60 |
+
image = generate_image(api_key, emotion_prediction)
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
|
| 64 |
# Define a function to generate an image using DeepAI Text to Image API
|
| 65 |
+
def generate_image(api_key, text):
|
| 66 |
url = "https://api.deepai.org/api/text2img"
|
| 67 |
headers = {'api-key': api_key}
|
| 68 |
response = requests.post(
|
| 69 |
url,
|
| 70 |
data={
|
| 71 |
+
'text': text,
|
| 72 |
},
|
| 73 |
headers=headers
|
| 74 |
)
|