JaredBailey commited on
Commit
0ff9eb8
Β·
verified Β·
1 Parent(s): 85f71fe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -16
app.py CHANGED
@@ -21,6 +21,7 @@ import streamlit.components.v1 as components
21
  from PIL import ImageOps, Image
22
  from ultralytics import YOLO
23
  from src.tiles import *
 
24
 
25
 
26
 
@@ -117,64 +118,56 @@ if st.session_state.screen == 1:
117
 
118
  image_path = "/home/user/app/test_images/"
119
  with row3_col1:
120
- img_1 = Image.open(image_path + "IMG_5356.JPG")
121
- img_1 = ImageOps.exif_transpose(img_1)
122
  st.image(img_1, use_column_width=True)
123
  if st.button("Select Image ↑", key="button_1", use_container_width=True):
124
  st.session_state.image = img_1
125
  st.session_state.screen = 2
126
  st.rerun()
127
  with row3_col2:
128
- img_2 = Image.open(image_path + "IMG_5357.JPG")
129
- img_2 = ImageOps.exif_transpose(img_2)
130
  st.image(img_2, use_column_width=True)
131
  if st.button("Select Image ↑", key="button_2", use_container_width=True):
132
  st.session_state.image = img_2
133
  st.session_state.screen = 2
134
  st.rerun()
135
  with row3_col3:
136
- img_3 = Image.open(image_path + "IMG_5368.JPG")
137
- img_3 = ImageOps.exif_transpose(img_3)
138
  st.image(img_3, use_column_width=True)
139
  if st.button("Select Image ↑", key="button_3", use_container_width=True):
140
  st.session_state.image = img_3
141
  st.session_state.screen = 2
142
  st.rerun()
143
  with row3_col4:
144
- img_4 = Image.open(image_path + "IMG_5369.JPG", use_container_width=True)
145
- img_4 = ImageOps.exif_transpose(img_4)
146
  st.image(img_4, use_column_width=True)
147
  if st.button("Select Image ↑", key="button_4", use_container_width=True):
148
  st.session_state.image = img_4
149
  st.session_state.screen = 2
150
  st.rerun()
151
  with row4_col1:
152
- img_5 = Image.open(image_path + "IMG_5382.JPG")
153
- img_5 = ImageOps.exif_transpose(img_5)
154
  st.image(img_5, use_column_width=True)
155
  if st.button("Select Image ↑", key="button_5", use_container_width=True):
156
  st.session_state.image = img_5
157
  st.session_state.screen = 2
158
  st.rerun()
159
  with row4_col2:
160
- img_6 = Image.open(image_path + "IMG_5383.JPG")
161
- img_6 = ImageOps.exif_transpose(img_6)
162
  st.image(img_6, use_column_width=True)
163
  if st.button("Select Image ↑", key="button_6", use_container_width=True):
164
  st.session_state.image = img_6
165
  st.session_state.screen = 2
166
  st.rerun()
167
  with row4_col3:
168
- img_7 = Image.open(image_path + "IMG_5408.JPG")
169
- img_7 = ImageOps.exif_transpose(img_7)
170
  st.image(img_7, use_column_width=True)
171
  if st.button("Select Image ↑", key="button_7", use_container_width=True):
172
  st.session_state.image = img_7
173
  st.session_state.screen = 2
174
  st.rerun()
175
  with row4_col4:
176
- img_8 = Image.open(image_path + "IMG_5409.JPG")
177
- img_8 = ImageOps.exif_transpose(img_8)
178
  st.image(img_8, use_column_width=True)
179
  if st.button("Select Image ↑", key="button_8", use_container_width=True):
180
  st.session_state.image = img_8
 
21
  from PIL import ImageOps, Image
22
  from ultralytics import YOLO
23
  from src.tiles import *
24
+ from src.image_transform import *
25
 
26
 
27
 
 
118
 
119
  image_path = "/home/user/app/test_images/"
120
  with row3_col1:
121
+ img_1 = image_transform("IMG_5356.JPG", image_path)
 
122
  st.image(img_1, use_column_width=True)
123
  if st.button("Select Image ↑", key="button_1", use_container_width=True):
124
  st.session_state.image = img_1
125
  st.session_state.screen = 2
126
  st.rerun()
127
  with row3_col2:
128
+ img_2 = image_transform("IMG_5357.JPG", image_path)
 
129
  st.image(img_2, use_column_width=True)
130
  if st.button("Select Image ↑", key="button_2", use_container_width=True):
131
  st.session_state.image = img_2
132
  st.session_state.screen = 2
133
  st.rerun()
134
  with row3_col3:
135
+ img_3 = image_transform("IMG_5368.JPG", image_path)
 
136
  st.image(img_3, use_column_width=True)
137
  if st.button("Select Image ↑", key="button_3", use_container_width=True):
138
  st.session_state.image = img_3
139
  st.session_state.screen = 2
140
  st.rerun()
141
  with row3_col4:
142
+ img_4 = image_transform("IMG_5369.JPG", image_path)
 
143
  st.image(img_4, use_column_width=True)
144
  if st.button("Select Image ↑", key="button_4", use_container_width=True):
145
  st.session_state.image = img_4
146
  st.session_state.screen = 2
147
  st.rerun()
148
  with row4_col1:
149
+ img_5 = image_transform("IMG_5382.JPG", image_path)
 
150
  st.image(img_5, use_column_width=True)
151
  if st.button("Select Image ↑", key="button_5", use_container_width=True):
152
  st.session_state.image = img_5
153
  st.session_state.screen = 2
154
  st.rerun()
155
  with row4_col2:
156
+ img_6 = image_transform("IMG_5383.JPG", image_path)
 
157
  st.image(img_6, use_column_width=True)
158
  if st.button("Select Image ↑", key="button_6", use_container_width=True):
159
  st.session_state.image = img_6
160
  st.session_state.screen = 2
161
  st.rerun()
162
  with row4_col3:
163
+ img_7 = image_transform("IMG_5408.JPG", image_path)
 
164
  st.image(img_7, use_column_width=True)
165
  if st.button("Select Image ↑", key="button_7", use_container_width=True):
166
  st.session_state.image = img_7
167
  st.session_state.screen = 2
168
  st.rerun()
169
  with row4_col4:
170
+ img_8 = image_transform("IMG_5409.JPG", image_path)
 
171
  st.image(img_8, use_column_width=True)
172
  if st.button("Select Image ↑", key="button_8", use_container_width=True):
173
  st.session_state.image = img_8