JaredBailey commited on
Commit
a14971f
Β·
verified Β·
1 Parent(s): 84e74b4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -17
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 row3_col2:
66
- img_2 = Image.open(image_path + "IMG_5382.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_col3:
72
- img_3 = Image.open(image_path + "IMG_5357.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 row3_col3:
78
- img_4 = Image.open(image_path + "IMG_5383.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 row2_col4:
84
- img_5 = Image.open(image_path + "IMG_5368.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_col4:
90
- img_6 = Image.open(image_path + "IMG_5408.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 row2_col5:
96
- img_7 = Image.open(image_path + "IMG_5369.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,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