XSpaceCoderX commited on
Commit
aef3cbc
·
verified ·
1 Parent(s): 2b8d114

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +125 -3
README.md CHANGED
@@ -1,3 +1,125 @@
1
- ---
2
- license: gpl-3.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: gpl-3.0
3
+ task_categories:
4
+ - tabular-classification
5
+ - tabular-regression
6
+ - image-to-3d
7
+ - depth-estimation
8
+ pretty_name: ACE Trajectories no Tosses
9
+ size_categories:
10
+ - n<1K
11
+ ---
12
+
13
+ **Paper in the making**
14
+
15
+ ---
16
+
17
+ # ACE-Trajectories_noTosses Dataset
18
+
19
+ This dataset was created for the Master's thesis *"From Broadcast to 3D: A Deep Learning Approach for Tennis Trajectory and Spin Estimation"* by Alexandra Göppert at the University Augsburg, Chair of Machine Learning and Computer Vision.
20
+
21
+ This datasets serves as an enriched version of the original TrackNet Tennis dataset. It cuts the whole rallies included in the TrackNet dataset in single trajectories, based on TrackNets property “Trajectory Pattern”. It supplements the original broadcast TrackNet data with manual ball spin annotations and 2D human pose estimations for the hitting player. It was specifically designed to be used as a validation and test set (split 33% to 66% respectively) for the 2D-to-3D trajectory uplifting models available in the [tennisuplifting GitHub repository](https://github.com/xSpaceCoder).
22
+ This dataset does not contain any images but uses primarily coordinates for indicating the position of the ball, the 16 court keypoints (see image) as well as the 17 COCO Whole Body keypoints (see end of file) of the hitting player on the respective image.
23
+
24
+ **Serves in this dataset do not contain ball tosses. For included ball tosses go to ACE-Trajectories_withTosses.**
25
+
26
+ <img src="./keypoints.png" alt="Court Keypoints" height="200">
27
+
28
+
29
+ ### Original TrackNet Data
30
+ The foundation of this dataset is the TrackNet dataset, which consists of broadcast tennis videos and 2D ball tracking data. The original dataset was introduced in [this paper](https://arxiv.org/abs/1907.03698) and downloaded from [Kaggle](https://www.kaggle.com/datasets/sofuskonglevoll/tracknet-tennis).
31
+
32
+ ---
33
+
34
+ ## Folder Structure
35
+
36
+ The repository is organized into 517 sequentially numbered folders, ranging from **`trajectory_0000`** to **`trajectory_0516`**. Each folder represents a single, continuous tennis trajectory like groundstroke, volley, smash and serves (without the preceding ball toss).
37
+
38
+ Inside each `trajectory_xxxx` folder, you will find exactly **eight separate `.npy` files** and **one `info.json` file** containing the isolated data for that specific sequence.
39
+
40
+
41
+ ACE-Trajectories/
42
+ ├── Readme.md
43
+ ├── data/
44
+ │ &emsp; ├── trajectory_0000/
45
+ │ &emsp;│ &emsp;├── 2dPoseEstimation.npy
46
+ │ &emsp;│ &emsp;├── Mext.npy
47
+ │ &emsp;│ &emsp;├── Mint.npy
48
+ │ &emsp;│ &emsp;├── hits.npy
49
+ │ &emsp;│ &emsp;├── r_img.npy
50
+ │ &emsp;│ &emsp;├── spin_class.npy
51
+ │ &emsp;│ &emsp;├── start_serve.npy
52
+ │ &emsp;│ &emsp;├── times.npy
53
+ │ &emsp;│ &emsp;└── info.json
54
+ │ &emsp;├── trajectory_0001/
55
+ │ &emsp;│ &emsp;├── 2dPoseEstimation.npy
56
+ │ &emsp;│ &emsp;├── Mext.npy
57
+ │ &emsp;│ &emsp;├── Mint.npy
58
+ │ &emsp;│ &emsp;├── hits.npy
59
+ │ &emsp;│ &emsp;├── r_img.npy
60
+ │ &emsp;│ &emsp;├── spin_class.npy
61
+ │ &emsp;│ &emsp;├── start_serve.npy
62
+ │ &emsp;│ &emsp;├── times.npy
63
+ │ &emsp;│ &emsp;└── info.json
64
+ │ &emsp;│ ...
65
+ │ &emsp;│ ...
66
+ │ &emsp;└── trajectory_0516
67
+ │ &emsp;│ &emsp;├── 2dPoseEstimation.npy
68
+ │ &emsp;│ &emsp;├── Mext.npy
69
+ │ &emsp;│ &emsp;├── Mint.npy
70
+ │ &emsp;│ &emsp;├── hits.npy
71
+ │ &emsp;│ &emsp;├── r_img.npy
72
+ │ &emsp;│ &emsp;├── spin_class.npy
73
+ │ &emsp;│ &emsp;├── start_serve.npy
74
+ │ &emsp;│ &emsp;├── times.npy
75
+ │ &emsp;│ &emsp;└── info.json
76
+
77
+ ---
78
+
79
+ ### The JSON File
80
+ * **`info.json`**: This file contains the essential metadata linking this trajectory back to the original TrackNet data. The fields include the specific game and clip the trajectory was cut from, as well as the exact **start frame number** and **end frame number** relative to the original TrackNet video.
81
+
82
+ ### The NPY Files
83
+ The eight numpy arrays store the spatial, temporal, and pose data for the trajectory:
84
+
85
+ * **`Mint.npy`**: A [3 x 3] array representing the reverse-engineered intrinsic camera matrix.
86
+ * **`Mext.npy`**: A [3 x 4] array representing the reverse-engineered extrinsic camera matrix (containing the rotation matrix and translation vector).
87
+ * **`times.npy`**: A 1D array of length [T] (where T is the total number of frames in the trajectory) containing the exact timestamps for each frame.
88
+ * **`r_img.npy`**: A [T x 3] array containing the 2D ball tracking data per frame. The three columns represent the **`u`** (horizontal) coordinate, the **`v`** (vertical) coordinate, and a **visibility class**. The visibility class is binary, where 0 means the ball is out of frame/occluded, 1 means visible or hard to spot. The visibility class was directly extracke out of the TrackNet Dataset.
89
+ * **`2dPoseEstimation.npy`**: A [17 x 3] array containing the 2D human pose estimation of the hitting player when the racket touches the ball. The rows correspond to the 17 [COCO-WholeBody keypoints](https://arxiv.org/abs/2007.11858), and the columns represent the **`u`** coordinate, **`v`** coordinate, and a model confidence **`score`**. For whole serves, this pose is captured at the specific frame where the ball leaves the server's hand (or the first frame if the toss isn't visible).
90
+ * **`spin_class.npy`**: A 1D array of length [T] repeating the initial spin class for the length of the trajectory. The classes are categorized as **1 (topspin)** and **2 (backspin)**
91
+ * **`new_trajectory_frame_idx.npy`**: An array of length [S] providing the exact frame indices (time steps) at which each new trajectory begins and the corresponding new spin value can be measured.
92
+ * **`hits.npy`**: An array of length [H] providing the time stamps when the ball bounces on the floor. Normally, this H = 1 or H = 0, but if the ball is the final in the rally H can be greater 1.
93
+
94
+ ## Download and Usage
95
+
96
+ This dataset utilizes Git LFS (Large File Storage) for binary `.npy` files. To ensure that the actual data is downloaded instead of small text pointers, please use the `huggingface_hub` library.
97
+
98
+ ### Installation
99
+ ``` bash
100
+ pip install huggingface_hub numpy
101
+ ```
102
+
103
+ ### Dowload the full dataset
104
+ ```
105
+ from huggingface_hub import snapshot_download
106
+
107
+ snapshot_download(
108
+ repo_id="XSpaceCoderX/ACE-Trajectories_noTosses",
109
+ repo_type="dataset",
110
+ local_dir="./data"
111
+ )
112
+ ```
113
+
114
+ ### Loading the data
115
+
116
+
117
+ ```
118
+ import numpy as np
119
+
120
+ # Example: Loading a specific file after download
121
+ data = np.load("./data/path/to/file.npy", allow_pickle=True)
122
+ print(f"Data shape: {data.shape}")
123
+ ```
124
+
125
+ <img src="./COCO_whole_body_keypoints.png" alt="COCO WholeBody keypoints" style="width:50%; height:auto;" >