Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -114,9 +114,6 @@
|
|
114 |
# st.warning("Please upload an image.")
|
115 |
|
116 |
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
import streamlit as st
|
121 |
import base64
|
122 |
import openai
|
@@ -148,8 +145,7 @@ if uploaded_file:
|
|
148 |
st.image(uploaded_file, caption=uploaded_file.name, width=image_width, use_column_width=False)
|
149 |
|
150 |
# Toggle for showing additional details input
|
151 |
-
show_details = st.toggle("Optional: Add details about the image. "
|
152 |
-
"The details could include specific information that is important to include in the alt text or reflect why the image is being used.", value=False)
|
153 |
|
154 |
# Toggle for modifying the prompt for complex images
|
155 |
complex_image = st.toggle("Is this a complex image? "
|
@@ -158,7 +154,7 @@ complex_image = st.toggle("Is this a complex image? "
|
|
158 |
if show_details:
|
159 |
# Text input for additional details about the image, shown only if toggle is True
|
160 |
additional_details = st.text_area(
|
161 |
-
"
|
162 |
disabled=not show_details
|
163 |
)
|
164 |
|
@@ -186,7 +182,7 @@ if uploaded_file is not None and analyze_button:
|
|
186 |
else:
|
187 |
prompt_text = (
|
188 |
"As an expert in image accessibility and alternative text, succinctly describe the image provided in less than 125 characters. "
|
189 |
-
"Provide a brief description that conveys the essential information conveyed by the image in three or fewer clear and concise sentences for use as alt text. "
|
190 |
"Skip phrases like 'image of' or 'picture of.' "
|
191 |
"Your description should form a clear, well-structured, and factual paragraph that avoids bullet points, focusing on creating a seamless narrative that serves as effective alternative text for accessibility purposes."
|
192 |
)
|
|
|
114 |
# st.warning("Please upload an image.")
|
115 |
|
116 |
|
|
|
|
|
|
|
117 |
import streamlit as st
|
118 |
import base64
|
119 |
import openai
|
|
|
145 |
st.image(uploaded_file, caption=uploaded_file.name, width=image_width, use_column_width=False)
|
146 |
|
147 |
# Toggle for showing additional details input
|
148 |
+
show_details = st.toggle("Optional: Add details about the image. ", value=False)
|
|
|
149 |
|
150 |
# Toggle for modifying the prompt for complex images
|
151 |
complex_image = st.toggle("Is this a complex image? "
|
|
|
154 |
if show_details:
|
155 |
# Text input for additional details about the image, shown only if toggle is True
|
156 |
additional_details = st.text_area(
|
157 |
+
"The details could include specific information that is important to include in the alt text or reflect why the image is being used:",
|
158 |
disabled=not show_details
|
159 |
)
|
160 |
|
|
|
182 |
else:
|
183 |
prompt_text = (
|
184 |
"As an expert in image accessibility and alternative text, succinctly describe the image provided in less than 125 characters. "
|
185 |
+
"Provide a brief description using not more than 125 characters that conveys the essential information conveyed by the image in three or fewer clear and concise sentences for use as alt text. "
|
186 |
"Skip phrases like 'image of' or 'picture of.' "
|
187 |
"Your description should form a clear, well-structured, and factual paragraph that avoids bullet points, focusing on creating a seamless narrative that serves as effective alternative text for accessibility purposes."
|
188 |
)
|