Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,13 +6,16 @@ import tensorflow as tf
|
|
| 6 |
import streamlit as st
|
| 7 |
|
| 8 |
# Open the video file
|
| 9 |
-
|
| 10 |
|
| 11 |
if video_file is not None:
|
| 12 |
# Read the video file from the file-like object
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
# Get the frames per second (fps) of the video
|
| 18 |
fps = (cap.get(cv2.CAP_PROP_FPS))
|
|
|
|
| 6 |
import streamlit as st
|
| 7 |
|
| 8 |
# Open the video file
|
| 9 |
+
f = st.file_uploader("Choose a Video")
|
| 10 |
|
| 11 |
if video_file is not None:
|
| 12 |
# Read the video file from the file-like object
|
| 13 |
+
|
| 14 |
+
tfile = tempfile.NamedTemporaryFile(delete=False)
|
| 15 |
+
tfile.write(f.read())
|
| 16 |
+
|
| 17 |
+
# Opens the Video file
|
| 18 |
+
cap= cv2.VideoCapture(tfile.name)
|
| 19 |
|
| 20 |
# Get the frames per second (fps) of the video
|
| 21 |
fps = (cap.get(cv2.CAP_PROP_FPS))
|