Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] UCF101-24 preparation #219

Merged
merged 5 commits into from
Sep 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

**New Features**
- Support to run real-time action recognition from web camera ([#171](https://github.com/open-mmlab/mmaction2/pull/171))
- Support to export the pytorch models to onnx ones. ([#160](https://github.com/open-mmlab/mmaction2/pull/160))
- Support to export pytorch models to onnx ([#160](https://github.com/open-mmlab/mmaction2/pull/160))
- Support UCF101-24 preparation ([#219](https://github.com/open-mmlab/mmaction2/pull/219))
- Support to report mAP for ActivityNet with [CUHK17_activitynet_pred](http://activity-net.org/challenges/2017/evaluation.html). ([#176](https://github.com/open-mmlab/mmaction2/pull/176))
- Add the data pipeline for ActivityNet, which includes downloading videos, extracting RGB and Flow frames, finetuning TSN and extracting feature. ([#190](https://github.com/open-mmlab/mmaction2/pull/190))

Expand Down
1 change: 1 addition & 0 deletions docs/data_preparation.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ To ease usage, we provide tutorials of data deployment for each dataset.
- [Moments in Time](http://moments.csail.mit.edu/): See [preparing_mit.md](/tools/data/mit/preparing_mit.md)
- [Multi-Moments in Time](http://moments.csail.mit.edu/challenge_iccv_2019.html): See [preparing_mmit.md](/tools/data/mmit/preparing_mmit.md)
- ActivityNet_feature: See [praparing_activitynet.md](/tools/data/activitynet/preparing_activitynet.md)
- [UCF101-24](http://www.thumos.info/download.html): See [preparing_ucf101_24.md](/tools/data/ucf101_24/preparing_ucf101_24.md)

Now, you can switch to [getting_started.md](getting_started.md) to train and test the model.

Expand Down
70 changes: 70 additions & 0 deletions tools/data/ucf101_24/preparing_ucf101_24.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Preparing UCF101-24

For basic dataset information, you can refer to the dataset [website](http://www.thumos.info/download.html).
Before we start, please make sure that the directory is located at `$MMACTION2/tools/data/ucf101_24/`.

## Download and Extract

You can download the RGB frames, optical flow and ground truth annotations from [google drive](https://drive.google.com/drive/folders/1BvGywlAGrACEqRyfYbz3wzlVV3cDFkct).
The data are provided from [MOC](https://github.com/MCG-NJU/MOC-Detector/blob/master/readme/Dataset.md), which is adapted from [act-detector](https://github.com/vkalogeiton/caffe/tree/act-detector) and [corrected-UCF101-Annots](https://github.com/gurkirt/corrected-UCF101-Annots).

**Note**: The annotation of this UCF101-24 is from [here](https://github.com/gurkirt/corrected-UCF101-Annots), which is more correct.

After downloading the `UCF101_v2.tar.gz` file and put it in `$MMACTION2/tools/data/ucf101_24/`, you can run the following command to extract.

```shell script
tar -zxvf UCF101_v2.tar.gz
```

## Check Directory Structure

After extracting, you will get the `rgb-images` directory, `brox-images` directory and `UCF101v2-GT.pkl` for UCF101-24.

In the context of the whole project (for UCF101-24 only), the folder structure will look like:

```
mmaction2
├── mmaction
├── tools
├── configs
├── data
│ ├── ucf101_24
│ | ├── brox-images
│ | | ├── Basketball
│ | | | ├── v_Basketball_g01_c01
│ | | | | ├── 00001.jpg
│ | | | | ├── 00002.jpg
│ | | | | ├── ...
│ | | | | ├── 00140.jpg
│ | | | | ├── 00141.jpg
│ | | ├── ...
│ | | ├── WalkingWithDog
│ | | | ├── v_WalkingWithDog_g01_c01
│ | | | ├── ...
│ | | | ├── v_WalkingWithDog_g25_c04
│ | ├── rgb-images
│ | | ├── Basketball
│ | | | ├── v_Basketball_g01_c01
│ | | | | ├── 00001.jpg
│ | | | | ├── 00002.jpg
│ | | | | ├── ...
│ | | | | ├── 00140.jpg
│ | | | | ├── 00141.jpg
│ | | ├── ...
│ | | ├── WalkingWithDog
│ | | | ├── v_WalkingWithDog_g01_c01
│ | | | ├── ...
│ | | | ├── v_WalkingWithDog_g25_c04
│ | ├── UCF101v2-GT.pkl

```

**Note**: The `UCF101v2-GT.pkl` exists as a cache, it contains 6 items as follows:
1. `labels` (list): List of the 24 labels.
2. `gttubes` (dict): Dictionary that contains the ground truth tubes for each video.
A **gttube** is dictionary that associates with each index of label and a list of tubes.
A **tube** is a numpy array with `nframes` rows and 5 columns, each col is in format like `<frame index> <x1> <y1> <x2> <y2>`.
3. `nframes` (dict): Dictionary that contains the number of frames for each video, like `'HorseRiding/v_HorseRiding_g05_c02': 151`.
4. `train_videos` (list): A list with `nsplits=1` elements, each one containing the list of training videos.
5. `test_videos` (list): A list with `nsplits=1` elements, each one containing the list of testing videos.
6. `resolution` (dict): Dictionary that outputs a tuple (h,w) of the resolution for each video, like `'FloorGymnastics/v_FloorGymnastics_g09_c03': (240, 320)`.