chethu commited on
Commit
a265c6d
1 Parent(s): f29c8fa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -7
app.py CHANGED
@@ -3,21 +3,30 @@ from PIL import Image
3
  from predictions import get_predictions
4
 
5
  def main():
6
- st.title("AI-Powered Audio Assistant")
 
 
7
 
8
  # Sidebar for uploading image
9
  st.sidebar.title("Upload Image")
10
  uploaded_image = st.sidebar.file_uploader("Choose an image...", type=["jpg", "jpeg", "png"])
11
 
12
  if uploaded_image is not None:
13
- # Get predictions
14
- processed_image, text, audio = get_predictions(uploaded_image)
 
15
 
16
- # Display processed image with bounding boxes
17
- st.image(processed_image, caption="Output image with predicted instances", use_column_width=True)
 
18
 
19
- # Play generated audio
20
- st.audio(audio, format="audio/wav")
 
 
 
 
 
21
 
22
  if __name__ == "__main__":
23
  main()
 
3
  from predictions import get_predictions
4
 
5
  def main():
6
+ st.set_page_config(page_title="ImageWhisper - AI Powered Audio Assistant", layout="wide")
7
+ st.title("ImageWhisper - AI Powered Audio Assistant")
8
+ st.markdown("---")
9
 
10
  # Sidebar for uploading image
11
  st.sidebar.title("Upload Image")
12
  uploaded_image = st.sidebar.file_uploader("Choose an image...", type=["jpg", "jpeg", "png"])
13
 
14
  if uploaded_image is not None:
15
+ if st.button("Get Results"):
16
+ # Get predictions
17
+ processed_image, text, audio = get_predictions(uploaded_image)
18
 
19
+ # Display processed image with bounding boxes
20
+ st.subheader("Processed Image with Predicted Instances")
21
+ st.image(processed_image, caption="Output image with predicted instances", use_column_width=True)
22
 
23
+ # Play generated audio
24
+ st.subheader("Generated Audio")
25
+ st.audio(audio, format="audio/wav", caption="Click to play the generated audio")
26
+
27
+ # Show extracted text
28
+ st.subheader("Extracted Text")
29
+ st.write(text)
30
 
31
  if __name__ == "__main__":
32
  main()