Spaces:
Running
Running
Upload app.py
Browse files
app.py
CHANGED
@@ -59,8 +59,8 @@ if page == 'PS1':
|
|
59 |
uploaded_file = st.file_uploader("Choose a video...", type=["mp4", "mpeg"])
|
60 |
model = YOLO('yolov8n.pt')
|
61 |
if uploaded_file is not None:
|
62 |
-
with tempfile.NamedTemporaryFile() as temp:
|
63 |
-
temp.write(uploaded_file.
|
64 |
if 'roi_list1' not in st.session_state:
|
65 |
st.session_state['roi_list1'] = []
|
66 |
if "all_rois1" not in st.session_state:
|
@@ -75,7 +75,7 @@ if page == 'PS1':
|
|
75 |
ret,frame=cap.read()
|
76 |
cv2.putText(frame,'SELECT ROI',(100,100),cv2.FONT_HERSHEY_SIMPLEX, 1,(0,0,255),4)
|
77 |
if not ret:
|
78 |
-
st.write('ROI selection
|
79 |
break
|
80 |
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
|
81 |
value = streamlit_image_coordinates(frame,key='numpy',width=750)
|
|
|
59 |
uploaded_file = st.file_uploader("Choose a video...", type=["mp4", "mpeg"])
|
60 |
model = YOLO('yolov8n.pt')
|
61 |
if uploaded_file is not None:
|
62 |
+
with tempfile.NamedTemporaryFile(delete=False) as temp:
|
63 |
+
temp.write(uploaded_file.read())
|
64 |
if 'roi_list1' not in st.session_state:
|
65 |
st.session_state['roi_list1'] = []
|
66 |
if "all_rois1" not in st.session_state:
|
|
|
75 |
ret,frame=cap.read()
|
76 |
cv2.putText(frame,'SELECT ROI',(100,100),cv2.FONT_HERSHEY_SIMPLEX, 1,(0,0,255),4)
|
77 |
if not ret:
|
78 |
+
st.write('ROI selection unsuccessfull')
|
79 |
break
|
80 |
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
|
81 |
value = streamlit_image_coordinates(frame,key='numpy',width=750)
|