从视频中逐帧保存 Mediapipe Face Mesh Landmarks

Saving Mediapipe Face Mesh Landmarks frame by frame from a video

I want to know how to save the output of facial landmarks frame by frame from a video using Mediapipe.

您需要遍历 multi_face_landmarks 并将它们追加到列表中,然后您可以这样做:

columns = []
for i in range(1, 469):
    columns.append('x_'+str(i))
    columns.append('y_'+str(i))

data = pd.DataFrame(training_data, columns=columns)
data['label'] = 'somelabel'
data.to_csv('Data/filename.csv', index=False)