Update app.py
Browse files
app.py
CHANGED
|
@@ -14,20 +14,18 @@ def main():
|
|
| 14 |
st.title("Sock Image Uploader")
|
| 15 |
|
| 16 |
# Image uploader
|
| 17 |
-
uploaded_file = st.file_uploader("Take a picture of your sock and upload it here", type=["jpg", "png"]
|
| 18 |
-
|
| 19 |
-
#
|
| 20 |
-
if
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
for idx, img in enumerate(st.session_state.images, start=1):
|
| 30 |
-
st.image(img, caption=f"Image {idx}", use_column_width=True)
|
| 31 |
|
| 32 |
# Reset button
|
| 33 |
if st.button('Reset and Start Over'):
|
|
|
|
| 14 |
st.title("Sock Image Uploader")
|
| 15 |
|
| 16 |
# Image uploader
|
| 17 |
+
uploaded_file = st.file_uploader("Take a picture of your sock and upload it here", type=["jpg", "png"])
|
| 18 |
+
|
| 19 |
+
# Button to confirm the upload and process the image
|
| 20 |
+
if st.button("Upload Next Image"):
|
| 21 |
+
if uploaded_file is not None:
|
| 22 |
+
# Convert the file to an image
|
| 23 |
+
image = Image.open(uploaded_file)
|
| 24 |
+
st.session_state.images.append(image)
|
| 25 |
+
|
| 26 |
+
# Display images
|
| 27 |
+
for idx, img in enumerate(st.session_state.images, start=1):
|
| 28 |
+
st.image(img, caption=f"Image {idx}", use_column_width=True)
|
|
|
|
|
|
|
| 29 |
|
| 30 |
# Reset button
|
| 31 |
if st.button('Reset and Start Over'):
|