AI, we don't believe that you can fly bro pt 3
This commit is contained in:
18
training.py
18
training.py
@@ -158,15 +158,17 @@ def get_features_sequence(landmarks_seq, max_frames=100):
|
|||||||
if len(landmarks_seq) > 1:
|
if len(landmarks_seq) > 1:
|
||||||
deltas[1:] = landmarks_seq[1:] - landmarks_seq[:-1]
|
deltas[1:] = landmarks_seq[1:] - landmarks_seq[:-1]
|
||||||
|
|
||||||
# Combine all features
|
# Flatten each component separately, then concatenate
|
||||||
seq = np.concatenate([
|
landmarks_flat = landmarks_seq.reshape(landmarks_seq.shape[0], -1) # (T, 63)
|
||||||
landmarks_seq, # (T, 21, 3)
|
deltas_flat = deltas.reshape(deltas.shape[0], -1) # (T, 63)
|
||||||
deltas, # (T, 21, 3)
|
# curl_features is already (T, 5)
|
||||||
curl_features[:, :, np.newaxis] # (T, 5, 1)
|
|
||||||
], axis=2)
|
|
||||||
|
|
||||||
# Flatten spatial dimensions: (T, 21*3 + 21*3 + 5) = (T, 131)
|
# Combine: 63 + 63 + 5 = 131 features per frame
|
||||||
seq = seq.reshape(seq.shape[0], -1)
|
seq = np.concatenate([
|
||||||
|
landmarks_flat,
|
||||||
|
deltas_flat,
|
||||||
|
curl_features
|
||||||
|
], axis=1)
|
||||||
|
|
||||||
# Pad or truncate to max_frames
|
# Pad or truncate to max_frames
|
||||||
T, F = seq.shape
|
T, F = seq.shape
|
||||||
|
|||||||
Reference in New Issue
Block a user