Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -81,20 +81,22 @@ ga_script = """
|
|
| 81 |
</script>
|
| 82 |
"""
|
| 83 |
|
| 84 |
-
#
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
)
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
|
|
|
| 100 |
demo.launch()
|
|
|
|
|
|
| 81 |
</script>
|
| 82 |
"""
|
| 83 |
|
| 84 |
+
# Use Gradio Blocks to organize the layout
|
| 85 |
+
with gr.Blocks() as demo:
|
| 86 |
+
gr.HTML(ga_script) # Injecting Google Analytics script
|
| 87 |
+
gr.Markdown(description_text) # Adding the description as Markdown
|
| 88 |
+
|
| 89 |
+
# Define the Interface components within Blocks
|
| 90 |
+
gr.Interface(
|
| 91 |
+
fn=detect_object,
|
| 92 |
+
inputs=gr.Image(label="Upload an Image", type="pil"),
|
| 93 |
+
outputs=[
|
| 94 |
+
gr.Image(label="Processed Image", type="pil"),
|
| 95 |
+
gr.Audio(label="Generated Audio")
|
| 96 |
+
],
|
| 97 |
+
title="Multi-Object Detection with Audio Narration",
|
| 98 |
+
)
|
| 99 |
+
|
| 100 |
+
# Launch the Blocks interface
|
| 101 |
demo.launch()
|
| 102 |
+
|