You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
506 B
Python
16 lines
506 B
Python
import numpy as np
|
|
from ml_gestures.feature_extractor import normalize_landmarks
|
|
|
|
def extract_sequence(landmarks_seq):
|
|
"""
|
|
landmarks_seq: список массивов (каждый (33,4) или (33,3))
|
|
Возвращает np.array формы (seq_len, 99)
|
|
"""
|
|
seq = []
|
|
for lm in landmarks_seq:
|
|
if lm is None:
|
|
seq.append(np.zeros(99)) # если пропущен кадр
|
|
else:
|
|
seq.append(normalize_landmarks(lm))
|
|
return np.array(seq)
|