ProfessorLeVesseur commited on
Commit
79b952e
·
verified ·
1 Parent(s): ac833ba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -13
app.py CHANGED
@@ -17,21 +17,17 @@ st.image('MTSS.ai_Logo.png', width=image_width)
17
  st.header('VisionText™ | Accessibility')
18
  st.subheader(':green[_Image Alt Text Generator_]')
19
 
20
-
21
- # st.title('VisionText™ | Accessibility')
22
- # st.subheader(':green[_Image Alt Text Generator_]')
23
-
24
  # Retrieve the OpenAI API Key from secrets
25
  openai.api_key = st.secrets["openai_api_key"]
26
 
27
- # File uploader allows user to add their own image
28
- uploaded_file = st.file_uploader("Upload an image", type=["jpg", "png", "jpeg"])
29
 
30
- if uploaded_file:
31
- # Display the uploaded image with specified width
32
- image_width = 150 # Set the desired width in pixels
33
- with st.expander("Image", expanded=True):
34
- st.image(uploaded_file, caption=uploaded_file.name, width=image_width, use_column_width=False)
35
 
36
  # Toggle for showing additional details input
37
  show_details = st.toggle("Add details about the image. ", value=False)
@@ -53,7 +49,6 @@ if complex_image:
53
  "You will add the description in a placeholder behind the image and add the text, 'Description in the content placeholder,' in the alt text box. "
54
  )
55
 
56
-
57
  # Button to trigger the analysis
58
  analyze_button = st.button("Analyze the Image", type="secondary")
59
 
@@ -138,4 +133,14 @@ if uploaded_file is not None and analyze_button:
138
  else:
139
  # Warnings for user action required
140
  if not uploaded_file and analyze_button:
141
- st.warning("Please upload an image.")
 
 
 
 
 
 
 
 
 
 
 
17
  st.header('VisionText™ | Accessibility')
18
  st.subheader(':green[_Image Alt Text Generator_]')
19
 
 
 
 
 
20
  # Retrieve the OpenAI API Key from secrets
21
  openai.api_key = st.secrets["openai_api_key"]
22
 
23
+ # # File uploader allows user to add their own image
24
+ # uploaded_file = st.file_uploader("Upload an image", type=["jpg", "png", "jpeg"])
25
 
26
+ # if uploaded_file:
27
+ # # Display the uploaded image with specified width
28
+ # image_width = 150 # Set the desired width in pixels
29
+ # with st.expander("Image", expanded=True):
30
+ # st.image(uploaded_file, caption=uploaded_file.name, width=image_width, use_column_width=False)
31
 
32
  # Toggle for showing additional details input
33
  show_details = st.toggle("Add details about the image. ", value=False)
 
49
  "You will add the description in a placeholder behind the image and add the text, 'Description in the content placeholder,' in the alt text box. "
50
  )
51
 
 
52
  # Button to trigger the analysis
53
  analyze_button = st.button("Analyze the Image", type="secondary")
54
 
 
133
  else:
134
  # Warnings for user action required
135
  if not uploaded_file and analyze_button:
136
+ st.warning("Please upload an image.")
137
+
138
+
139
+ # File uploader allows user to add their own image
140
+ uploaded_file = st.file_uploader("Upload an image", type=["jpg", "png", "jpeg"])
141
+
142
+ if uploaded_file:
143
+ # Display the uploaded image with specified width
144
+ image_width = 150 # Set the desired width in pixels
145
+ with st.expander("Image", expanded=True):
146
+ st.image(uploaded_file, caption=uploaded_file.name, width=image_width, use_column_width=False)