Skip to content

Commit

Permalink
add data preparation md for UCF-101
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamerlin committed Jun 30, 2020
1 parent c1da4b0 commit dc38d68
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ venv.bak/

# custom
mmaction/version.py
data
/data
.vscode
.idea
*.pkl
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repos:
- repo: https://github.com/timothycrosley/isort
rev: 4.3.21
hooks:
- id: isort
- id: isort
- repo: https://github.com/pre-commit/mirrors-yapf
rev: v0.29.0
hooks:
Expand Down
100 changes: 100 additions & 0 deletions tools/data/ucf101/preparing_ucf101.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# Preparing UCF-101

For basic dataset information, you can refer to the dataset [website](https://www.crcv.ucf.edu/data/UCF101.php).
Before we start, please make sure that the directory is located at `$MMACTION/tools/data/ucf101/`.

## Step 1. Prepare Annotations

First of all, you can run the following script to prepare annotations.

```shell
bash download_annotations.sh
```

## Prepare Videos

Then, you can run the following script to prepare videos.

```shell
bash download_videos.sh
```

## Extract RGB and Flow

This part is **optional** if you only want to use the video loader.

Before extracting, please refer to [install.md](/docs/install.md) for installing [dense_flow](https://github.com/yjxiong/dense_flow).

If you have plenty of SSD, then we recommend extracting frames there for better I/O performance. The extracted frames (RGB + Flow) will take up about 100GB.

If you didn't install dense_flow in the installation or only want to play with RGB frames (since extracting optical flow can be time-comsuming), consider running the following script to extract **RGB-only** frames.

```shell
bash extract_rgb_frames.sh
```

If both are required, run the following script to extract frames.

```shell
bash extract_frames.sh
```

Then, You can run the following script to soft link the extracted frames.

```shell
# execute these two line (Assume the SSD is mounted at "/mnt/SSD/")
mkdir /mnt/SSD/ucf101_extracted/
ln -s /mnt/SSD/ucf101_extracted/ ../../../data/ucf101/rawframes
```

## Generate File List

you can run the follow script to generate file list in the format of rawframes and videos.

```shell
bash generate_filelist.sh
```

## Directory Structure

After the whole data process for UCF-101 preparation,
you will get the rawframes (RGB + Flow), videos and annotation files for UCF-101.

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

```
mmaction
├── mmaction
├── tools
├── configs
├── data
│ ├── ucf101
│ │ ├── ucf101_{train,val}_split_{1,2,3}_rawframes.txt
│ │ ├── ucf101_{train,val}_split_{1,2,3}_videos.txt
│ │ ├── annotations
│ │ ├── videos
│ │ │ ├── ApplyEyeMakeup
│ │ │ │ ├── v_ApplyEyeMakeup_g01_c01.avi
│ │ │ ├── YoYo
│ │ │ │ ├── v_YoYo_g25_c05.avi
│ │ ├── rawframes
│ │ │ ├── ApplyEyeMakeup
│ │ │ │ ├── v_ApplyEyeMakeup_g01_c01
│ │ │ │ │ ├── img_00001.jpg
│ │ │ │ │ ├── img_00002.jpg
│ │ │ │ │ ├── ...
│ │ │ │ │ ├── flow_x_00001.jpg
│ │ │ │ │ ├── flow_x_00002.jpg
│ │ │ │ │ ├── ...
│ │ │ │ │ ├── flow_y_00001.jpg
│ │ │ │ │ ├── flow_y_00002.jpg
│ │ │ ├── ...
│ │ │ ├── YoYo
│ │ │ │ ├── v_YoYo_g01_c01
│ │ │ │ ├── ...
│ │ │ │ ├── v_YoYo_g25_c05
```

For training and evaluating on UCF-101, please refer to [getting_started.md](/docs/getting_started.md).

0 comments on commit dc38d68

Please sign in to comment.