JaredBailey commited on
Commit
150f131
·
verified ·
1 Parent(s): 82eddba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -6
app.py CHANGED
@@ -6,6 +6,7 @@
6
  import streamlit as st
7
  import streamlit.components.v1 as components
8
  from PIL import ImageOps, Image
 
9
 
10
  #####
11
  ###
@@ -106,10 +107,21 @@ with row3_col5:
106
  # Output and Interaction
107
  ###
108
  #####
109
- st.write("\n\n")
110
- components.html("""<hr style="height:2px;border:none;color:#333;background-color:#333;" /> """)
111
 
112
- _, col_1, col_2, _ = st.columns([1, 4, 4, 1], gap="medium")
113
- with col_2:
114
- if st.session_state.image is not None:
115
- st.image(st.session_state.image, use_column_width=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  import streamlit as st
7
  import streamlit.components.v1 as components
8
  from PIL import ImageOps, Image
9
+ from ultralytics import YOLO
10
 
11
  #####
12
  ###
 
107
  # Output and Interaction
108
  ###
109
  #####
110
+ if st.session_state.image is not None:
 
111
 
112
+ st.write("\n\n")
113
+ components.html("""<hr style="height:2px;border:none;color:#333;background-color:#333;" /> """)
114
+
115
+ # model
116
+ model = YOLO("/home/user/app/models/head_model/best.pt") # load
117
+ pred = model.predict([st.session_state.image]) # predict
118
+
119
+
120
+ _, col_1, col_2, _ = st.columns([1, 4, 4, 1], gap="medium")
121
+ with col_1:
122
+ st.write('small image 1 here')
123
+ st.image(pred)
124
+ with col_2:
125
+ st.image(st.session_state.image, use_column_width=True)
126
+
127
+