|
a |
|
b/tools/data/ava/README.md |
|
|
1 |
# Preparing AVA |
|
|
2 |
|
|
|
3 |
## Introduction |
|
|
4 |
|
|
|
5 |
<!-- [DATASET] --> |
|
|
6 |
|
|
|
7 |
```BibTeX |
|
|
8 |
@inproceedings{gu2018ava, |
|
|
9 |
title={Ava: A video dataset of spatio-temporally localized atomic visual actions}, |
|
|
10 |
author={Gu, Chunhui and Sun, Chen and Ross, David A and Vondrick, Carl and Pantofaru, Caroline and Li, Yeqing and Vijayanarasimhan, Sudheendra and Toderici, George and Ricco, Susanna and Sukthankar, Rahul and others}, |
|
|
11 |
booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition}, |
|
|
12 |
pages={6047--6056}, |
|
|
13 |
year={2018} |
|
|
14 |
} |
|
|
15 |
``` |
|
|
16 |
|
|
|
17 |
For basic dataset information, please refer to the official [website](https://research.google.com/ava/index.html). |
|
|
18 |
Before we start, please make sure that the directory is located at `$MMACTION2/tools/data/ava/`. |
|
|
19 |
|
|
|
20 |
## Step 1. Prepare Annotations |
|
|
21 |
|
|
|
22 |
First of all, you can run the following script to prepare annotations. |
|
|
23 |
|
|
|
24 |
```shell |
|
|
25 |
bash download_annotations.sh |
|
|
26 |
``` |
|
|
27 |
|
|
|
28 |
This command will download `ava_v2.1.zip` for AVA `v2.1` annotation. If you need the AVA `v2.2` annotation, you can try the following script. |
|
|
29 |
|
|
|
30 |
```shell |
|
|
31 |
VERSION=2.2 bash download_annotations.sh |
|
|
32 |
``` |
|
|
33 |
|
|
|
34 |
## Step 2. Prepare Videos |
|
|
35 |
|
|
|
36 |
Then, use the following script to prepare videos. The codes are adapted from the [official crawler](https://github.com/cvdfoundation/ava-dataset). |
|
|
37 |
Note that this might take a long time. |
|
|
38 |
|
|
|
39 |
```shell |
|
|
40 |
bash download_videos.sh |
|
|
41 |
``` |
|
|
42 |
|
|
|
43 |
Or you can use the following command to downloading AVA videos in parallel using a python script. |
|
|
44 |
|
|
|
45 |
```shell |
|
|
46 |
bash download_videos_parallel.sh |
|
|
47 |
``` |
|
|
48 |
|
|
|
49 |
Note that if you happen to have sudoer or have [GNU parallel](https://www.gnu.org/software/parallel/) on your machine, |
|
|
50 |
you can speed up the procedure by downloading in parallel. |
|
|
51 |
|
|
|
52 |
```shell |
|
|
53 |
# sudo apt-get install parallel |
|
|
54 |
bash download_videos_gnu_parallel.sh |
|
|
55 |
``` |
|
|
56 |
|
|
|
57 |
## Step 3. Cut Videos |
|
|
58 |
|
|
|
59 |
Cut each video from its 15th to 30th minute and make them at 30 fps. |
|
|
60 |
|
|
|
61 |
```shell |
|
|
62 |
bash cut_videos.sh |
|
|
63 |
``` |
|
|
64 |
|
|
|
65 |
## Step 4. Extract RGB and Flow |
|
|
66 |
|
|
|
67 |
Before extracting, please refer to [install.md](/docs/install.md) for installing [denseflow](https://github.com/open-mmlab/denseflow). |
|
|
68 |
|
|
|
69 |
If you have plenty of SSD space, then we recommend extracting frames there for better I/O performance. And you can run the following script to soft link the extracted frames. |
|
|
70 |
|
|
|
71 |
```shell |
|
|
72 |
# execute these two line (Assume the SSD is mounted at "/mnt/SSD/") |
|
|
73 |
mkdir /mnt/SSD/ava_extracted/ |
|
|
74 |
ln -s /mnt/SSD/ava_extracted/ ../data/ava/rawframes/ |
|
|
75 |
``` |
|
|
76 |
|
|
|
77 |
If you only want to play with RGB frames (since extracting optical flow can be time-consuming), consider running the following script to extract **RGB-only** frames using denseflow. |
|
|
78 |
|
|
|
79 |
```shell |
|
|
80 |
bash extract_rgb_frames.sh |
|
|
81 |
``` |
|
|
82 |
|
|
|
83 |
If you didn't install denseflow, you can still extract RGB frames using ffmpeg by the following script. |
|
|
84 |
|
|
|
85 |
```shell |
|
|
86 |
bash extract_rgb_frames_ffmpeg.sh |
|
|
87 |
``` |
|
|
88 |
|
|
|
89 |
If both are required, run the following script to extract frames. |
|
|
90 |
|
|
|
91 |
```shell |
|
|
92 |
bash extract_frames.sh |
|
|
93 |
``` |
|
|
94 |
|
|
|
95 |
## Step 5. Fetch Proposal Files |
|
|
96 |
|
|
|
97 |
The scripts are adapted from FAIR's [Long-Term Feature Banks](https://github.com/facebookresearch/video-long-term-feature-banks). |
|
|
98 |
|
|
|
99 |
Run the following scripts to fetch the pre-computed proposal list. |
|
|
100 |
|
|
|
101 |
```shell |
|
|
102 |
bash fetch_ava_proposals.sh |
|
|
103 |
``` |
|
|
104 |
|
|
|
105 |
## Step 6. Folder Structure |
|
|
106 |
|
|
|
107 |
After the whole data pipeline for AVA preparation. |
|
|
108 |
you can get the rawframes (RGB + Flow), videos and annotation files for AVA. |
|
|
109 |
|
|
|
110 |
In the context of the whole project (for AVA only), the *minimal* folder structure will look like: |
|
|
111 |
(*minimal* means that some data are not necessary: for example, you may want to evaluate AVA using the original video format.) |
|
|
112 |
|
|
|
113 |
``` |
|
|
114 |
mmaction2 |
|
|
115 |
├── mmaction |
|
|
116 |
├── tools |
|
|
117 |
├── configs |
|
|
118 |
├── data |
|
|
119 |
│ ├── ava |
|
|
120 |
│ │ ├── annotations |
|
|
121 |
│ │ | ├── ava_dense_proposals_train.FAIR.recall_93.9.pkl |
|
|
122 |
│ │ | ├── ava_dense_proposals_val.FAIR.recall_93.9.pkl |
|
|
123 |
│ │ | ├── ava_dense_proposals_test.FAIR.recall_93.9.pkl |
|
|
124 |
│ │ | ├── ava_train_v2.1.csv |
|
|
125 |
│ │ | ├── ava_val_v2.1.csv |
|
|
126 |
│ │ | ├── ava_train_excluded_timestamps_v2.1.csv |
|
|
127 |
│ │ | ├── ava_val_excluded_timestamps_v2.1.csv |
|
|
128 |
│ │ | ├── ava_action_list_v2.1_for_activitynet_2018.pbtxt |
|
|
129 |
│ │ ├── videos |
|
|
130 |
│ │ │ ├── 053oq2xB3oU.mkv |
|
|
131 |
│ │ │ ├── 0f39OWEqJ24.mp4 |
|
|
132 |
│ │ │ ├── ... |
|
|
133 |
│ │ ├── videos_15min |
|
|
134 |
│ │ │ ├── 053oq2xB3oU.mkv |
|
|
135 |
│ │ │ ├── 0f39OWEqJ24.mp4 |
|
|
136 |
│ │ │ ├── ... |
|
|
137 |
│ │ ├── rawframes |
|
|
138 |
│ │ │ ├── 053oq2xB3oU |
|
|
139 |
| │ │ │ ├── img_00001.jpg |
|
|
140 |
| │ │ │ ├── img_00002.jpg |
|
|
141 |
| │ │ │ ├── ... |
|
|
142 |
``` |
|
|
143 |
|
|
|
144 |
For training and evaluating on AVA, please refer to [getting_started](/docs/getting_started.md). |
|
|
145 |
|
|
|
146 |
## Reference |
|
|
147 |
|
|
|
148 |
1. O. Tange (2018): GNU Parallel 2018, March 2018, https://doi.org/10.5281/zenodo.1146014 |