Spaces:
Runtime error
Runtime error
Commit
Β·
c97767e
1
Parent(s):
d84bc8b
Update app.py
Browse files
app.py
CHANGED
@@ -22,9 +22,17 @@ def load_video(video_path):
|
|
22 |
mean = tf.math.reduce_mean(frames)
|
23 |
std = tf.math.reduce_std(tf.cast(frames, tf.float32))
|
24 |
return tf.cast((frames - mean), tf.float32) / std
|
25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
frames = load_video(video_path)
|
27 |
|
|
|
28 |
return frames
|
29 |
|
30 |
|
|
|
22 |
mean = tf.math.reduce_mean(frames)
|
23 |
std = tf.math.reduce_std(tf.cast(frames, tf.float32))
|
24 |
return tf.cast((frames - mean), tf.float32) / std
|
25 |
+
|
26 |
+
def load_data(path: str):
|
27 |
+
path = bytes.decode(path.numpy())
|
28 |
+
#file_name = path.split('/')[-1].split('.')[0]
|
29 |
+
# File name splitting for windows
|
30 |
+
file_name = path.split('\\')[-1].split('.')[0]
|
31 |
+
video_path = os.path.join('data','s1',f'{file_name}.mpg')
|
32 |
+
alignment_path = os.path.join('data','alignments','s1',f'{file_name}.align')
|
33 |
frames = load_video(video_path)
|
34 |
|
35 |
+
|
36 |
return frames
|
37 |
|
38 |
|