Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -44,7 +44,7 @@ if 'image_counter' not in st.session_state:
|
|
| 44 |
st.session_state.image_counter = 0
|
| 45 |
|
| 46 |
if 'confidence' not in st.session_state:
|
| 47 |
-
st.session_state.confidence = 0.
|
| 48 |
|
| 49 |
if 'model' not in st.session_state:
|
| 50 |
st.session_state.model = YOLO("/home/user/app/models/head_model/best.pt") # load
|
|
@@ -217,7 +217,4 @@ if st.session_state.screen == 2:
|
|
| 217 |
# plot predicted image
|
| 218 |
im_bgr = st.session_state.results[st.session_state.image_counter].plot() # BGR-order numpy array
|
| 219 |
im_rgb = Image.fromarray(im_bgr[..., ::-1]) # RGB-order PIL image
|
| 220 |
-
st.image(im_rgb)
|
| 221 |
-
if 'results' in st.session_state or st.session_state.results != None:
|
| 222 |
-
st.session_state.confidence = st.slider(label="Change Model Confidence Level and Rerun", min_value=0.01, max_value=0.99, value=st.session_state.confidence, step=0.01)
|
| 223 |
-
st.session_state.results = None
|
|
|
|
| 44 |
st.session_state.image_counter = 0
|
| 45 |
|
| 46 |
if 'confidence' not in st.session_state:
|
| 47 |
+
st.session_state.confidence = 0.70
|
| 48 |
|
| 49 |
if 'model' not in st.session_state:
|
| 50 |
st.session_state.model = YOLO("/home/user/app/models/head_model/best.pt") # load
|
|
|
|
| 217 |
# plot predicted image
|
| 218 |
im_bgr = st.session_state.results[st.session_state.image_counter].plot() # BGR-order numpy array
|
| 219 |
im_rgb = Image.fromarray(im_bgr[..., ::-1]) # RGB-order PIL image
|
| 220 |
+
st.image(im_rgb)
|
|
|
|
|
|
|
|
|