Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -53,11 +53,19 @@ def process_image(image):
|
|
| 53 |
audio_file = text_to_speech_gtts(caption_pt)
|
| 54 |
return caption_pt, audio_file
|
| 55 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
# Interface Gradio
|
| 57 |
iface = gr.Interface(
|
| 58 |
fn=process_image,
|
| 59 |
inputs=gr.Image(type="filepath"),
|
| 60 |
outputs=[gr.Textbox(), gr.Audio(type="filepath")],
|
|
|
|
| 61 |
title="Image to Voice",
|
| 62 |
description="Gera uma descrição em português e a converte em voz a partir de uma imagem."
|
| 63 |
)
|
|
|
|
| 53 |
audio_file = text_to_speech_gtts(caption_pt)
|
| 54 |
return caption_pt, audio_file
|
| 55 |
|
| 56 |
+
# Caminhos para as imagens de exemplo (supondo que estejam no mesmo diretório que o script)
|
| 57 |
+
example_image_paths = [
|
| 58 |
+
"example1.jpg",
|
| 59 |
+
"example2.jpg",
|
| 60 |
+
"example3.jpg"
|
| 61 |
+
]
|
| 62 |
+
|
| 63 |
# Interface Gradio
|
| 64 |
iface = gr.Interface(
|
| 65 |
fn=process_image,
|
| 66 |
inputs=gr.Image(type="filepath"),
|
| 67 |
outputs=[gr.Textbox(), gr.Audio(type="filepath")],
|
| 68 |
+
examples=example_image_paths,
|
| 69 |
title="Image to Voice",
|
| 70 |
description="Gera uma descrição em português e a converte em voz a partir de uma imagem."
|
| 71 |
)
|