Spaces:
Runtime error
Runtime error
chuanenlin
commited on
Commit
•
83f868a
1
Parent(s):
d0419f9
Update videogenic.py
Browse files- videogenic.py +4 -4
videogenic.py
CHANGED
@@ -516,8 +516,8 @@ if st.session_state.progress == 1:
|
|
516 |
st.session_state.video = video_bytes
|
517 |
st.session_state.video = video_bytes
|
518 |
# st.video(st.session_state.video)
|
519 |
-
|
520 |
-
|
521 |
fps, x_dim, y_dim = video_to_info(video_name)
|
522 |
video_frames = np.load(f'files/{st.session_state.domain.lower()}.npy', allow_pickle=True)
|
523 |
if 'video_frames' not in st.session_state:
|
@@ -530,8 +530,8 @@ if st.session_state.progress == 1:
|
|
530 |
st.session_state.x_dim = x_dim
|
531 |
st.session_state.y_dim = y_dim
|
532 |
print('Extracted frames')
|
533 |
-
|
534 |
-
|
535 |
encoded_frames = np.load(f'files/{st.session_state.domain.lower()}_features.npy', allow_pickle=True)
|
536 |
if 'video_features' not in st.session_state:
|
537 |
# st.session_state.video_features = encoded_frames
|
|
|
516 |
st.session_state.video = video_bytes
|
517 |
st.session_state.video = video_bytes
|
518 |
# st.video(st.session_state.video)
|
519 |
+
video_frames, fps, x_dim, y_dim = video_to_frames(video_name) # first run; video_to_info
|
520 |
+
np.save(f'files/{st.session_state.domain.lower()}.npy', video_frames)
|
521 |
fps, x_dim, y_dim = video_to_info(video_name)
|
522 |
video_frames = np.load(f'files/{st.session_state.domain.lower()}.npy', allow_pickle=True)
|
523 |
if 'video_frames' not in st.session_state:
|
|
|
530 |
st.session_state.x_dim = x_dim
|
531 |
st.session_state.y_dim = y_dim
|
532 |
print('Extracted frames')
|
533 |
+
encoded_frames = encode_frames(video_frames) # first run
|
534 |
+
np.save(f'files/{st.session_state.domain.lower()}_features.npy', encoded_frames)
|
535 |
encoded_frames = np.load(f'files/{st.session_state.domain.lower()}_features.npy', allow_pickle=True)
|
536 |
if 'video_features' not in st.session_state:
|
537 |
# st.session_state.video_features = encoded_frames
|