Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -61,15 +61,27 @@ def detect_object(image):
|
|
| 61 |
processed_audio = generate_audio(description_text)
|
| 62 |
return processed_image, processed_audio
|
| 63 |
|
| 64 |
-
# Gradio interface
|
| 65 |
-
description_text = """
|
| 66 |
|
|
|
|
| 67 |
Upload an image to detect objects and hear a natural language description.
|
| 68 |
|
| 69 |
### Credits:
|
| 70 |
Developed by Taizun S
|
| 71 |
"""
|
| 72 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
demo = gr.Interface(
|
| 74 |
fn=detect_object,
|
| 75 |
inputs=gr.Image(label="Upload an Image", type="pil"),
|
|
@@ -81,4 +93,8 @@ demo = gr.Interface(
|
|
| 81 |
description=description_text,
|
| 82 |
)
|
| 83 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
demo.launch()
|
|
|
|
| 61 |
processed_audio = generate_audio(description_text)
|
| 62 |
return processed_image, processed_audio
|
| 63 |
|
|
|
|
|
|
|
| 64 |
|
| 65 |
+
description_text = """
|
| 66 |
Upload an image to detect objects and hear a natural language description.
|
| 67 |
|
| 68 |
### Credits:
|
| 69 |
Developed by Taizun S
|
| 70 |
"""
|
| 71 |
|
| 72 |
+
# Your Google Analytics script
|
| 73 |
+
ga_script = """
|
| 74 |
+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-WEYXHDZ3GQ"></script>
|
| 75 |
+
<script>
|
| 76 |
+
window.dataLayer = window.dataLayer || [];
|
| 77 |
+
function gtag(){dataLayer.push(arguments);}
|
| 78 |
+
gtag('js', new Date());
|
| 79 |
+
|
| 80 |
+
gtag('config', 'G-WEYXHDZ3GQ');
|
| 81 |
+
</script>
|
| 82 |
+
"""
|
| 83 |
+
|
| 84 |
+
# Define the Gradio interface
|
| 85 |
demo = gr.Interface(
|
| 86 |
fn=detect_object,
|
| 87 |
inputs=gr.Image(label="Upload an Image", type="pil"),
|
|
|
|
| 93 |
description=description_text,
|
| 94 |
)
|
| 95 |
|
| 96 |
+
# Add the Google Analytics script to the Gradio interface
|
| 97 |
+
demo.add_component(gr.HTML(ga_script))
|
| 98 |
+
|
| 99 |
+
# Launch the interface
|
| 100 |
demo.launch()
|