josmazna/padelpose
收藏Hugging Face2024-07-10 更新2024-07-06 收录
下载链接:
https://hf-mirror.com/datasets/josmazna/padelpose
下载链接
链接失效反馈官方服务:
资源简介:
该数据集包含了多个帕德尔(padel)击球动作的MediaPipe姿态关键点序列。每个.pkl文件包含了通过MediaPipe的`detect_for_video`函数返回的`PoseLandmarkerResult`,其中包含了33个姿态关键点的坐标信息(x, y, z)以及可见性和存在性信息。数据集中的击球动作包括正手击球、反手击球、正手截击、反手截击、Bandeja和Smash等。
This dataset contains sequences of MediaPipe pose landmarks for several padel strokes. Each .pkl file contains the `PoseLandmarkerResult` returned by `detect_for_video` from MediaPipe, which includes the coordinates (x, y, z) of 33 pose landmarks along with visibility and presence information. The strokes in the dataset include forehand, backhand, forehand volley, backhand volley, bandeja, and smash.
提供机构:
josmazna
原始信息汇总
数据集概述
该数据集包含多个padel击球动作的MediaPipe姿态地标序列。
类别
- 正手击球(Forehand) - 文件名:forehand (i).pkl
- 反手击球(Backhand) - 文件名:backhand (i).pkl
- 正手截击(Forehand Volley) - 文件名:fhvolley (i).pkl
- 反手截击(Backhand Volley) - 文件名:bhvolley (i).pkl
- 垫球(Bandeja) - 文件名:bandeja (i).pkl
- 扣杀(Smash) - 文件名:smash (i).pkl
文件内容
每个.pkl文件包含由MediaPipe的detect_for_video方法返回的PoseLandmarkerResult。
PoseLandmarkerResult结构
-
地标(Landmarks):
Landmark #0:x: 0.638852y: 0.671197z: 0.129959visibility: 0.9999997615814209presence: 0.9999984502792358
Landmark #1:x: 0.634599y: 0.536441z: -0.06984visibility: 0.999909presence: 0.999958
- ... (每个姿态包含33个地标)
-
世界地标(WorldLandmarks):
Landmark #0:x: 0.067485y: 0.031084z: 0.055223visibility: 0.9999997615814209presence: 0.9999984502792358
Landmark #1:x: 0.063209y: -0.00382z: 0.020920visibility: 0.999976presence: 0.999998
- ... (每个姿态包含33个世界地标)
数据加载
加载PoseLandmarkerResult
使用以下代码从.pkl文件加载PoseLandmarkerResult:
python
import joblib
detection_results = joblib.load(pkl_filepath)
加载完整数据集
使用以下示例代码将数据集加载到数组X、Y、Z和labels中。确保将folderpath指向包含数据集文件的目录。
python
import os
import joblib
def build_coordinates_dataset(folderpath): all_files = os.listdir(folderpath) pkl_filepaths = [os.path.join(folderpath, pkl_filepath) for pkl_filepath in all_files if pkl_filepath.endswith(".pkl")] print(f{len(pkl_filepaths)} samples found)
X, Y, Z, labels = [], [], [], []
for pkl_filepath in pkl_filepaths:
detection_results = joblib.load(pkl_filepath)
try:
loaded_pose_landmarks = detection_results
x_frames, y_frames, z_frames = [], [], []
for frame_detection_result in loaded_pose_landmarks:
landmarks = frame_detection_result.pose_world_landmarks[0]
x_landmarks, y_landmarks, z_landmarks = [], [], []
for i in landmarks:
x_landmarks.append(i.x)
y_landmarks.append(i.y)
z_landmarks.append(i.z)
x_frames.append(x_landmarks)
y_frames.append(y_landmarks)
z_frames.append(z_landmarks)
X.append(x_frames)
Y.append(y_frames)
Z.append(z_frames)
labels.append(os.path.basename(pkl_filepath)[:3])
except Exception as e:
print(e)
print(f"Error loading {pkl_filepath}")
return X, Y, Z, labels



