Spaces:
Sleeping
Sleeping
Ariel
commited on
Commit
·
f23756c
1
Parent(s):
c6cec04
Update files
Browse files- app.py +3 -1
- src/video_with_landmarks.py +3 -3
app.py
CHANGED
@@ -114,7 +114,9 @@ def video_identity(video):
|
|
114 |
"""
|
115 |
# 1. load video and process it with landmarks
|
116 |
original_video_path = video
|
117 |
-
|
|
|
|
|
118 |
src.video_with_landmarks.process_video_with_landmarks(original_video_path, output_path)
|
119 |
|
120 |
# 2. extract landmarks coordinates
|
|
|
114 |
"""
|
115 |
# 1. load video and process it with landmarks
|
116 |
original_video_path = video
|
117 |
+
current_directory = os.path.dirname(os.path.abspath(__file__))
|
118 |
+
output_file = "src/video_landmarks.mp4"
|
119 |
+
output_path = os.path.join(current_directory, output_file)
|
120 |
src.video_with_landmarks.process_video_with_landmarks(original_video_path, output_path)
|
121 |
|
122 |
# 2. extract landmarks coordinates
|
src/video_with_landmarks.py
CHANGED
@@ -28,9 +28,8 @@ def process_video_with_landmarks(video_path, output_path, scale_percent=100):
|
|
28 |
height = int(height * scale_percent / 100)
|
29 |
|
30 |
# Define the output video file
|
31 |
-
|
32 |
-
|
33 |
-
fourcc = cv2.VideoWriter_fourcc(*'HEVC')
|
34 |
out_fps = fps / 0.6 # Set the output fps to half of the original fps
|
35 |
out = cv2.VideoWriter(output_path, fourcc, out_fps, (width, height))
|
36 |
|
@@ -87,3 +86,4 @@ def process_video_with_landmarks(video_path, output_path, scale_percent=100):
|
|
87 |
cap.release()
|
88 |
out.release()
|
89 |
cv2.destroyAllWindows()
|
|
|
|
28 |
height = int(height * scale_percent / 100)
|
29 |
|
30 |
# Define the output video file
|
31 |
+
fourcc = cv2.VideoWriter_fourcc(*'h264')
|
32 |
+
# fourcc = cv2.VideoWriter_fourcc(*'HEVC')
|
|
|
33 |
out_fps = fps / 0.6 # Set the output fps to half of the original fps
|
34 |
out = cv2.VideoWriter(output_path, fourcc, out_fps, (width, height))
|
35 |
|
|
|
86 |
cap.release()
|
87 |
out.release()
|
88 |
cv2.destroyAllWindows()
|
89 |
+
return
|