JaredBailey commited on
Commit
627ed01
·
verified ·
1 Parent(s): c10a46f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -12
app.py CHANGED
@@ -30,13 +30,20 @@ if 'image_counter' not in st.session_state:
30
  #####
31
  # This displays while the model is loading
32
  # It provides the user with information about the tool
 
33
  _, row0_col1, _ = st.columns([1,3,1])
34
- st.markdown("<h1 style='text-align: center; color: black;'>Find Waldo and His Friends</h1>", unsafe_allow_html=True)
35
- st.markdown("<h3 style='text-align: center; color: black;'>Using Computer Vision</h3>", unsafe_allow_html=True)
36
- st.markdown("<p style='text-align: center; color: black;'>\
37
- This tool allows you to take a photo with your phone of a <i>Where's Waldo?</i> book page. \
38
- Using the computer vision model YOLOv8 (large option), this tool find Waldo and his friends Wenda, Odlaw, Wizard, and Woof. \
39
- The model takes about 30 seconds to load before the fun begins. Please be patient...</p>", unsafe_allow_html=True)
 
 
 
 
 
 
40
 
41
  #####
42
  ###
@@ -119,12 +126,7 @@ with row3_col5:
119
  img_8 = ImageOps.exif_transpose(img_8)
120
  st.image(img_8, use_column_width=True)
121
  if st.button(f"Select Image ↑", key="button_8"):
122
- st.session_state.image = img_8
123
-
124
- # load model
125
- if 'model' not in st.session_state:
126
- st.session_state.model = YOLO("/home/user/app/models/head_model/best.pt") # load
127
-
128
 
129
  #####
130
  ###
 
30
  #####
31
  # This displays while the model is loading
32
  # It provides the user with information about the tool
33
+ # This process takes around 30 seconds
34
  _, row0_col1, _ = st.columns([1,3,1])
35
+ if
36
+ # load model
37
+ if 'model' not in st.session_state:
38
+ with row0_col1:
39
+ st.markdown("<h1 style='text-align: center; color: black;'>Find Waldo and His Friends</h1>", unsafe_allow_html=True)
40
+ st.markdown("<h3 style='text-align: center; color: black;'>Using Computer Vision</h3>", unsafe_allow_html=True)
41
+ st.markdown("<p style='text-align: center; color: black;'>\
42
+ This tool allows you to take a photo with your phone of a <i>Where's Waldo?</i> book page. \
43
+ Using the computer vision model YOLOv8 (large option), this tool find Waldo and his friends Wenda, Odlaw, Wizard, and Woof. \
44
+ The model takes about 30 seconds to load before the fun begins. Please be patient...</p>", unsafe_allow_html=True)
45
+ st.image()
46
+ st.session_state.model = YOLO("/home/user/app/models/head_model/best.pt") # load
47
 
48
  #####
49
  ###
 
126
  img_8 = ImageOps.exif_transpose(img_8)
127
  st.image(img_8, use_column_width=True)
128
  if st.button(f"Select Image ↑", key="button_8"):
129
+ st.session_state.image = img_8
 
 
 
 
 
130
 
131
  #####
132
  ###