Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -94,13 +94,14 @@ def detect_image(image):
|
|
94 |
audio_path = generate_audio(natural_text)
|
95 |
print("π Audio Path:", audio_path)
|
96 |
processed_image = draw_detected_objects(image, output)
|
97 |
-
return processed_image, audio_path
|
98 |
except Exception as e:
|
99 |
print("β Error:", str(e))
|
100 |
return Image.new("RGB", (512, 512), color="gray"), None
|
101 |
|
102 |
|
103 |
|
|
|
104 |
# Launch Gradio app
|
105 |
demo = gr.Interface(
|
106 |
fn=detect_image,
|
@@ -113,5 +114,5 @@ demo = gr.Interface(
|
|
113 |
description="This app detects objects in images, highlights them, and generates a natural language audio description."
|
114 |
)
|
115 |
|
116 |
-
demo.launch()
|
117 |
|
|
|
94 |
audio_path = generate_audio(natural_text)
|
95 |
print("π Audio Path:", audio_path)
|
96 |
processed_image = draw_detected_objects(image, output)
|
97 |
+
return processed_image.convert("RGB"), audio_path # π Force RGB
|
98 |
except Exception as e:
|
99 |
print("β Error:", str(e))
|
100 |
return Image.new("RGB", (512, 512), color="gray"), None
|
101 |
|
102 |
|
103 |
|
104 |
+
|
105 |
# Launch Gradio app
|
106 |
demo = gr.Interface(
|
107 |
fn=detect_image,
|
|
|
114 |
description="This app detects objects in images, highlights them, and generates a natural language audio description."
|
115 |
)
|
116 |
|
117 |
+
demo.launch(share=True)
|
118 |
|