adil9858 commited on
Commit
aeadb75
Β·
verified Β·
1 Parent(s): c2d4854

Update app.py

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