Spaces:
Sleeping
Sleeping
luxmorocco
commited on
Commit
•
b0f3194
1
Parent(s):
d5f864e
Update app.py
Browse files
app.py
CHANGED
@@ -138,6 +138,13 @@ def display_annotation_list():
|
|
138 |
if st.button("Delete", key=f"delete_{i}"):
|
139 |
st.session_state["annotations"].pop(i)
|
140 |
st.rerun()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
141 |
def save_annotations(image, uploaded_file):
|
142 |
"""Handle saving and downloading annotations"""
|
143 |
st.sidebar.subheader("💾 Save & Export")
|
@@ -217,6 +224,11 @@ def main():
|
|
217 |
|
218 |
if not authenticate_user():
|
219 |
return
|
|
|
|
|
|
|
|
|
|
|
220 |
|
221 |
# File upload
|
222 |
uploaded_file = st.file_uploader(
|
|
|
138 |
if st.button("Delete", key=f"delete_{i}"):
|
139 |
st.session_state["annotations"].pop(i)
|
140 |
st.rerun()
|
141 |
+
|
142 |
+
|
143 |
+
def load_demo_image():
|
144 |
+
"""Load demo prescription image"""
|
145 |
+
demo_image_url = "/ordonnance-002.jpeg"
|
146 |
+
return Image.open(requests.get(demo_image_url, stream=True).raw).convert("RGB")
|
147 |
+
|
148 |
def save_annotations(image, uploaded_file):
|
149 |
"""Handle saving and downloading annotations"""
|
150 |
st.sidebar.subheader("💾 Save & Export")
|
|
|
224 |
|
225 |
if not authenticate_user():
|
226 |
return
|
227 |
+
|
228 |
+
if st.button("📋 Load Demo Prescription"):
|
229 |
+
demo_image = load_demo_image()
|
230 |
+
uploaded_file = demo_image
|
231 |
+
st.success("Demo prescription loaded successfully!")
|
232 |
|
233 |
# File upload
|
234 |
uploaded_file = st.file_uploader(
|