Commit
·
0801672
1
Parent(s):
8d575db
Fix upload flow indentation; show prompt when no image uploaded
Browse files
app.py
CHANGED
|
@@ -60,12 +60,14 @@ def run_streamlit_ui():
|
|
| 60 |
uploaded_file = st.file_uploader("Choose image", accept_multiple_files=False, type=["png", "jpg", "jpeg"])
|
| 61 |
|
| 62 |
if uploaded_file is not None:
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
|
|
|
|
|
|
| 66 |
else:
|
| 67 |
-
|
| 68 |
-
|
| 69 |
|
| 70 |
# Resize the image while maintaining aspect ratio
|
| 71 |
max_size = 2000
|
|
|
|
| 60 |
uploaded_file = st.file_uploader("Choose image", accept_multiple_files=False, type=["png", "jpg", "jpeg"])
|
| 61 |
|
| 62 |
if uploaded_file is not None:
|
| 63 |
+
if st.session_state.reuse_image is not None:
|
| 64 |
+
img_input = Image.fromarray(st.session_state.reuse_image)
|
| 65 |
+
else:
|
| 66 |
+
bytes_data = uploaded_file.getvalue()
|
| 67 |
+
img_input = Image.open(BytesIO(bytes_data)).convert("RGBA")
|
| 68 |
else:
|
| 69 |
+
st.info("Please upload an image to begin.")
|
| 70 |
+
return
|
| 71 |
|
| 72 |
# Resize the image while maintaining aspect ratio
|
| 73 |
max_size = 2000
|