Spaces:
Build error
Build error
Commit
·
7b662f1
1
Parent(s):
ee65817
Update extract_landmarks.py
Browse files- extract_landmarks.py +1 -4
extract_landmarks.py
CHANGED
@@ -4,7 +4,6 @@ from landmark_utils import detect_frames_track
|
|
4 |
|
5 |
def detect_track(video):
|
6 |
vidcap = cv2.VideoCapture(video)
|
7 |
-
fps = vidcap.get(cv2.CAP_PROP_FPS)
|
8 |
frames = []
|
9 |
while True:
|
10 |
success, image = vidcap.read()
|
@@ -12,20 +11,18 @@ def detect_track(video):
|
|
12 |
frames.append(image)
|
13 |
else:
|
14 |
break
|
15 |
-
raw_data = detect_frames_track(frames
|
16 |
|
17 |
vidcap.release()
|
18 |
return np.array(raw_data)
|
19 |
|
20 |
def extract_landmark(video):
|
21 |
raw_data = detect_track(video)
|
22 |
-
print("video=",video)
|
23 |
if len(raw_data) == 0:
|
24 |
pass
|
25 |
else:
|
26 |
np.savetxt(video + ".txt", raw_data, fmt='%1.5f')
|
27 |
path = video + ".txt"
|
28 |
-
print(path)
|
29 |
return path
|
30 |
|
31 |
def get_data_for_test(path, fake, block): # fake:manipulated=1 original=0
|
|
|
4 |
|
5 |
def detect_track(video):
|
6 |
vidcap = cv2.VideoCapture(video)
|
|
|
7 |
frames = []
|
8 |
while True:
|
9 |
success, image = vidcap.read()
|
|
|
11 |
frames.append(image)
|
12 |
else:
|
13 |
break
|
14 |
+
raw_data = detect_frames_track(frames)
|
15 |
|
16 |
vidcap.release()
|
17 |
return np.array(raw_data)
|
18 |
|
19 |
def extract_landmark(video):
|
20 |
raw_data = detect_track(video)
|
|
|
21 |
if len(raw_data) == 0:
|
22 |
pass
|
23 |
else:
|
24 |
np.savetxt(video + ".txt", raw_data, fmt='%1.5f')
|
25 |
path = video + ".txt"
|
|
|
26 |
return path
|
27 |
|
28 |
def get_data_for_test(path, fake, block): # fake:manipulated=1 original=0
|