Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -62,38 +62,38 @@ with row2_col2:
|
|
| 62 |
st.image(img_1, use_column_width=True)
|
| 63 |
if st.button(f"Select Image β", key="button_1"):
|
| 64 |
st.session_state.image = img_1
|
| 65 |
-
with
|
| 66 |
-
img_2 = Image.open(image_path + "
|
| 67 |
img_2 = ImageOps.exif_transpose(img_2)
|
| 68 |
st.image(img_2, use_column_width=True)
|
| 69 |
if st.button(f"Select Image β", key="button_2"):
|
| 70 |
st.session_state.image = img_2
|
| 71 |
-
with
|
| 72 |
-
img_3 = Image.open(image_path + "
|
| 73 |
img_3 = ImageOps.exif_transpose(img_3)
|
| 74 |
st.image(img_3, use_column_width=True)
|
| 75 |
if st.button(f"Select Image β", key="button_3"):
|
| 76 |
st.session_state.image = img_3
|
| 77 |
-
with
|
| 78 |
-
img_4 = Image.open(image_path + "
|
| 79 |
img_4 = ImageOps.exif_transpose(img_4)
|
| 80 |
st.image(img_4, use_column_width=True)
|
| 81 |
if st.button(f"Select Image β", key="button_4"):
|
| 82 |
st.session_state.image = img_4
|
| 83 |
-
with
|
| 84 |
-
img_5 = Image.open(image_path + "
|
| 85 |
img_5 = ImageOps.exif_transpose(img_5)
|
| 86 |
st.image(img_5, use_column_width=True)
|
| 87 |
if st.button(f"Select Image β", key="button_5"):
|
| 88 |
st.session_state.image = img_5
|
| 89 |
-
with
|
| 90 |
-
img_6 = Image.open(image_path + "
|
| 91 |
img_6 = ImageOps.exif_transpose(img_6)
|
| 92 |
st.image(img_6, use_column_width=True)
|
| 93 |
if st.button(f"Select Image β", key="button_6"):
|
| 94 |
st.session_state.image = img_6
|
| 95 |
-
with
|
| 96 |
-
img_7 = Image.open(image_path + "
|
| 97 |
img_7 = ImageOps.exif_transpose(img_7)
|
| 98 |
st.image(img_7, use_column_width=True)
|
| 99 |
if st.button(f"Select Image β", key="button_7"):
|
|
@@ -149,15 +149,15 @@ if st.session_state.image is not None:
|
|
| 149 |
row4a_col3, row4b_col3= st.columns([1,1], gap="medium")
|
| 150 |
with row4a_col3:
|
| 151 |
if st.button("Back"):
|
| 152 |
-
if session_state.image_counter > 0:
|
| 153 |
-
session_state.image_counter -= 1
|
| 154 |
with row4b_col3:
|
| 155 |
if st.button("Next"):
|
| 156 |
-
if session_state.image_counter < len(results):
|
| 157 |
-
session_state.image_counter -= 1
|
| 158 |
|
| 159 |
# Plot predicted image
|
| 160 |
-
im_bgr = results[session_state.image_counter].plot() # BGR-order numpy array
|
| 161 |
im_rgb = Image.fromarray(im_bgr[..., ::-1]) # RGB-order PIL image
|
| 162 |
st.image(im_rgb)
|
| 163 |
|
|
|
|
| 62 |
st.image(img_1, use_column_width=True)
|
| 63 |
if st.button(f"Select Image β", key="button_1"):
|
| 64 |
st.session_state.image = img_1
|
| 65 |
+
with row2_col3:
|
| 66 |
+
img_2 = Image.open(image_path + "IMG_5357.JPG")
|
| 67 |
img_2 = ImageOps.exif_transpose(img_2)
|
| 68 |
st.image(img_2, use_column_width=True)
|
| 69 |
if st.button(f"Select Image β", key="button_2"):
|
| 70 |
st.session_state.image = img_2
|
| 71 |
+
with row2_col4:
|
| 72 |
+
img_3 = Image.open(image_path + "IMG_5368.JPG")
|
| 73 |
img_3 = ImageOps.exif_transpose(img_3)
|
| 74 |
st.image(img_3, use_column_width=True)
|
| 75 |
if st.button(f"Select Image β", key="button_3"):
|
| 76 |
st.session_state.image = img_3
|
| 77 |
+
with row2_col5:
|
| 78 |
+
img_4 = Image.open(image_path + "IMG_5369.JPG")
|
| 79 |
img_4 = ImageOps.exif_transpose(img_4)
|
| 80 |
st.image(img_4, use_column_width=True)
|
| 81 |
if st.button(f"Select Image β", key="button_4"):
|
| 82 |
st.session_state.image = img_4
|
| 83 |
+
with row3_col2:
|
| 84 |
+
img_5 = Image.open(image_path + "IMG_5382.JPG")
|
| 85 |
img_5 = ImageOps.exif_transpose(img_5)
|
| 86 |
st.image(img_5, use_column_width=True)
|
| 87 |
if st.button(f"Select Image β", key="button_5"):
|
| 88 |
st.session_state.image = img_5
|
| 89 |
+
with row3_col3:
|
| 90 |
+
img_6 = Image.open(image_path + "IMG_5383.JPG")
|
| 91 |
img_6 = ImageOps.exif_transpose(img_6)
|
| 92 |
st.image(img_6, use_column_width=True)
|
| 93 |
if st.button(f"Select Image β", key="button_6"):
|
| 94 |
st.session_state.image = img_6
|
| 95 |
+
with row3_col4:
|
| 96 |
+
img_7 = Image.open(image_path + "IMG_5408.JPG")
|
| 97 |
img_7 = ImageOps.exif_transpose(img_7)
|
| 98 |
st.image(img_7, use_column_width=True)
|
| 99 |
if st.button(f"Select Image β", key="button_7"):
|
|
|
|
| 149 |
row4a_col3, row4b_col3= st.columns([1,1], gap="medium")
|
| 150 |
with row4a_col3:
|
| 151 |
if st.button("Back"):
|
| 152 |
+
if st.session_state.image_counter > 0:
|
| 153 |
+
st.session_state.image_counter -= 1
|
| 154 |
with row4b_col3:
|
| 155 |
if st.button("Next"):
|
| 156 |
+
if st.session_state.image_counter < len(results):
|
| 157 |
+
st.session_state.image_counter -= 1
|
| 158 |
|
| 159 |
# Plot predicted image
|
| 160 |
+
im_bgr = results[st.session_state.image_counter].plot() # BGR-order numpy array
|
| 161 |
im_rgb = Image.fromarray(im_bgr[..., ::-1]) # RGB-order PIL image
|
| 162 |
st.image(im_rgb)
|
| 163 |
|