Preparation of AVA-Dataset Format for Training on Custom Dataset

See original GitHub issue

Thanks for nice work . I have seen the “demo.gif” which is the output of the model which is trained on the “AVA-Dataset” .Now I want to convert my custom dataset into “AVA-Dataset Format” and want to train a model using your given code . Can you guide me what are pre-processing steps I need to do to convert my own custom dataset into the AVA Dataset Format. Can you give me brief idea or any tools which help me to achieve the “AVA-Dataset Format” . Thanks

I have data set now as follow

Dataset/
├── Class-A
│         └── insp.mp4
├── Class-B
│          └── kep.mp4
└── Class-C
             └── tak.mp4 

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:8
  • Comments:71 (19 by maintainers)

github_iconTop GitHub Comments

29reactions
AlexanderMeldecommented, Nov 6, 2020

Yes! Let’s say your dataset is named MyData, you should structure your files and folders like this:

SlowFast/
├── configs/
│       └── MyData/
│               └── I3D_8x8_R50.yaml
├── data/
│       └── MyData/
│               ├── ClassA/
│               │      └── ins.mp4
│               ├── ClassB/
│               │      └── kep.mp4
│               ├── ClassC/
│               |      └── tak.mp4
│               ├── train.csv
│               ├── test.csv
│               ├── val.csv
│               └── classids.json
├── slowfast/
│       └── datasets/
│               ├── __init__.py
│               ├── mydata.py
│               └── ...
└── ...

As you can see, you will need to create a config file (.yaml), three files for the dataset split (.csv), a file for referencing classes (.json) and a file for dataset parsing (mydata.py).

To create the python file mydata.py, duplicate kinetics.py which is located in the same folder, rename it to mydata.py and replace all occurences of Kinetics by Mydata (search and replace, case-sensitive)

Once created, you will also need to import the newly created python file to the project by adding the line from .mydata import Mydata to the __init__.py file in the same folder.

The classids.json file contains a mapping of class names and ids. It will look like the following:

{"ClassA": 0, "ClassB": 1, "ClassC": 2}

The .csv files define which of the videos will be used for training, validation and inference testing, and which classes they reference.

They should look like the following:

/SlowFast/data/MyData/ClassA/ins.mp4 0
/SlowFast/data/MyData/ClassC/tak.mp4 2

For larger datasets, it will propably be the easiest to create files like this using an automated script that parses classids.json and the folder structure.

Note that all three files should not share any identical lines (use the same video) and pay attention to your actual paths (absolute or relative paths can be used).

Last but not least, you will need to create a configuration file to train or test the network. You can copy an existing one from the SlowFast/configs/Kinetics folder, e.g. I3D_8x8_R50.yaml.

In the copied file, replace all occurences of kinetics by mydata (case-sensitive).

You can run SlowFast with the new config that references your own dataset by running

python /SlowFast/tools/run_net.py --cfg /SlowFast/configs/MyData/I3D_8x8_R50.yaml

Note that you might need to adjust pathes to your actual working directory.

I hope this guide will help you guys using SlowFast with your own datasets 😃

3reactions
x2sscommented, Dec 9, 2021

Hi all,

After I have read this issue, I can not find the guide to create the “AVA-Dataset Format”. Apparently, AVA dataset needs human box and its corresponding action label. The discussions above are mainly focused on classifying the whole video.

Or have I missed anything? Maybe this issue #652 from mmaction2 is a related issue

Best!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ava Dataset Format Preparation for Custom Dataset
But my question is related to Ava dataset format preparation for a custom dataset. Can you guide me on what are pre-processing step...
Read more >
mmaction.datasets.ava_dataset - MMAction2's documentation!
Based on official AVA annotation files, the dataset loads raw frames, bounding boxes, ... idx): """Prepare the frames for training given the index....
Read more >
[slowfast training your own dataset] customize the action ...
Catalog ; 1.1 Video preparation · 1.2 Cut video into pictures · 1.3 Use faster rcnn Automatic frame person ; 3.1 Pre training...
Read more >
Step-by-step instructions for training YOLOv7 on a Custom ...
We will first set up the Python code to run in a notebook. Next, we will download the custom dataset, and convert the...
Read more >
AVA - getava - THOTH
The AVA dataset contains 192 videos split into 154 training and 38 test videos. Each video has 15 minutes annotated in 3 second...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found