Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -7,23 +7,21 @@ st.title("Image Whisper App")
|
|
7 |
|
8 |
uploaded_image = st.file_uploader("Upload an image", type=["jpg", "jpeg", "png"])
|
9 |
|
10 |
-
if
|
11 |
-
st.
|
12 |
-
st.image(uploaded_image, use_column_width=True)
|
13 |
-
|
14 |
-
if st.button("Submit"):
|
15 |
processed_image, text, audio = get_predictions(uploaded_image)
|
16 |
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
st.write(text, "Narration in Text")
|
22 |
|
|
|
|
|
23 |
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
|
|
7 |
|
8 |
uploaded_image = st.file_uploader("Upload an image", type=["jpg", "jpeg", "png"])
|
9 |
|
10 |
+
if st.button("Submit"):
|
11 |
+
with st.spinner("Analyzing image and generating narration... Please wait."):
|
|
|
|
|
|
|
12 |
processed_image, text, audio = get_predictions(uploaded_image)
|
13 |
|
14 |
+
st.success("Analysis complete!")
|
15 |
+
|
16 |
+
st.subheader("Output image with predicted instances")
|
17 |
+
st.image(processed_image, use_column_width=True)
|
|
|
18 |
|
19 |
+
st.subheader("Textual Description")
|
20 |
+
st.write(text, "Narration in Text")
|
21 |
|
22 |
+
st.subheader("Audio Narration")
|
23 |
+
if isinstance(audio, tuple):
|
24 |
+
sample_rate, audio_data = audio
|
25 |
+
st.audio(audio_data, format='audio/wav', sample_rate=sample_rate)
|
26 |
+
else:
|
27 |
+
st.audio(audio, format='audio/wav')
|