Update app.py
Browse files
app.py
CHANGED
@@ -130,20 +130,20 @@ st.sidebar.markdown("Powered by [Together AI](https://together.ai) and Streamlit
|
|
130 |
img_file_buffer = st.camera_input("Take a picture")
|
131 |
|
132 |
if img_file_buffer is not None:
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
|
137 |
-
|
138 |
-
|
139 |
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
|
147 |
-
|
148 |
-
|
149 |
-
|
|
|
130 |
img_file_buffer = st.camera_input("Take a picture")
|
131 |
|
132 |
if img_file_buffer is not None:
|
133 |
+
|
134 |
+
# Convert the image file buffer to a PIL Image
|
135 |
+
img = Image.open(img_file_buffer)
|
136 |
|
137 |
+
# Display the captured image
|
138 |
+
st.image(img, caption='Captured Image', width=300)
|
139 |
|
140 |
+
# Get and display the description
|
141 |
+
with st.spinner('π Analyzing the image...'):
|
142 |
+
description = get_image_description(img)
|
143 |
+
st.success('β
Analysis complete!')
|
144 |
+
st.markdown("### AI Description:")
|
145 |
+
st.write(description)
|
146 |
|
147 |
+
# Convert description to speech and play it
|
148 |
+
|
149 |
+
tts(description)
|