Miraj3 commited on
Commit
a077881
Β·
verified Β·
1 Parent(s): 0ede05a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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