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

Can I know what is the size of the Kinetics 400 dataset used to reproduce the result in this repo? #1578

Open
yxchng opened this issue Dec 31, 2020 · 14 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@yxchng
Copy link

yxchng commented Dec 31, 2020

There are many links in Kinetics that have expired. As as result, everyone might not be using the same Kinetics dataset. As a reference, the statistics of the Kinetics dataset used in PySlowFast can be found here, https://github.com/facebookresearch/video-nonlocal-net/blob/master/DATASET.md. However, I cannot seem to find similar information for gluoncv. Will you guys be sharing the statistics and the dataset used? I need the complete dataset to reproduce the result.

@bryanyzhu
Copy link
Collaborator

Hi, we use a copy from here. There are 240618 training and 19404 validation videos. There is a simple readme for reproduction using GluonCV, and I'm still editing it. Please let me know if you have further questions. Thank you.

@bryanyzhu bryanyzhu self-assigned this Dec 31, 2020
@irvingzhang0512
Copy link

Hi, we use a copy from here. There are 240618 training and 19404 validation videos. There is a simple readme for reproduction using GluonCV, and I'm still editing it. Please let me know if you have further questions. Thank you.

thank you very much! kinetics-400/700 could be downloaded by Xunlei and Baiduyunpan...

@yxchng
Copy link
Author

yxchng commented Jan 1, 2021

@bryanyzhu Does this link still work I just tried but it is not downloading, always stuck at 0%

@irvingzhang0512 Can you post the link for Xunlei and Baiduyunpan here? Is it the same dataset with 240618 training and 19404 validation videos?

@irvingzhang0512
Copy link

@yxchng load the torrents in the above link to baiduyunpan and xunlei

@bryanyzhu bryanyzhu added the good first issue Good for newcomers label Jan 1, 2021
@irvingzhang0512
Copy link

After some tests, I find that kinetics-400 val set could be downloaded by xunlei with 1.5M/s. Kinetics-400/700 could be download by baiduyun with slow speed.

@StevenJokess
Copy link
Contributor

image
Setting file /root/.mxnet/datasets/kinetics400/kinetics400_train_list_rawframes.txt doesn't exist.
How to fix it?
It also happened.
Uploading image.png…

@bryanyzhu
Copy link
Collaborator

Hi @StevenJokess This setting file should be generated on your end, which contains the paths of the videos, duration of the videos and the label of the videos. Please read this tutorial on how to prepare K400 dataset. Thank you.

BTW, if you have further questions on using the code, please open a new issue. This issue is for (downloading) Kinetics400 dataset only.

@bychen7
Copy link

bychen7 commented Jan 11, 2021

@bryanyzhu If i want to train model using video data directly, how can i generate k400_train.txt? and in this tutorial this url was 404, Have you tested the script of this tutorial? Thanks!

@bryanyzhu
Copy link
Collaborator

I have tested the script half a year ago, but not recently. Thank you for pointing out the missing url issue, I will fix it.

In terms of generating k400_train.txt, once you download the videos from the torrent website (or you already have the data), you can use the following code to generate it.

import os
import sys

video_dir = '/home/ubuntu/data/kinetics400/train_256/'
classes = os.listdir(video_dir)
classes.sort()

anno_file = '/home/ubuntu/data/kinetics400/k400_train.txt'
f = open(anno_file, 'a')

class_id = 0
for each_class in classes:
    class_dir = os.path.join(video_dir, each_class)
    videos = os.listdir(class_dir)
    videos.sort()

    for each_video in videos:
        video_name = os.path.join(each_class, each_video)
        line_info = video_name + ' ' + str(300) + ' ' + str(class_id) + '\r\n'
        f.writelines(line_info)

    class_id += 1

Simply put, each video corresponds to one line in the txt file. There are three items in each line: video path, video duration and video label. Since our video reader can automatically get video duration information during video loading, we just need a placeholder 300 here to indicate the video duration (i.e., number of frames).

@bychen7
Copy link

bychen7 commented Jan 12, 2021

I have tested the script half a year ago, but not recently. Thank you for pointing out the missing url issue, I will fix it.

In terms of generating k400_train.txt, once you download the videos from the torrent website (or you already have the data), you can use the following code to generate it.

import os
import sys

video_dir = '/home/ubuntu/data/kinetics400/train_256/'
classes = os.listdir(video_dir)
classes.sort()

anno_file = '/home/ubuntu/data/kinetics400/k400_train.txt'
f = open(anno_file, 'a')

class_id = 0
for each_class in classes:
    class_dir = os.path.join(video_dir, each_class)
    videos = os.listdir(class_dir)
    videos.sort()

    for each_video in videos:
        video_name = os.path.join(each_class, each_video)
        line_info = video_name + ' ' + str(300) + ' ' + str(class_id) + '\r\n'
        f.writelines(line_info)

    class_id += 1

Simply put, each video corresponds to one line in the txt file. There are three items in each line: video path, video duration and video label. Since our video reader can automatically get video duration information during video loading, we just need a placeholder 300 here to indicate the video duration (i.e., number of frames).

Thanks for your response, I have started training, but when reading with decord, some video cannot be loaded as following, did you know why or how could I solve it?

video cannot be loaded by decord:  /data/kinetics400/videos_train/throwing_axe/Yse3yBzFgPo_1_10.mp4
/action/gluon-cv/gluoncv/torch/data/video_cls/dataset_classification.py:122: UserWarning: video throwing_axe/Yse3yBzFgPo_1_10.mp4 not correctly loaded during training
  warnings.warn("video {} not correctly loaded during training".format(sample))
[buffer @ 0x5607ed561640] Unable to parse option value "-1" as pixel format
[buffer @ 0x5607ed561640] Unable to parse option value "-1" as pixel format
[buffer @ 0x5607ed561640] Error setting option pix_fmt to value -1.
[in @ 0x5607edbff1c0] Error applying options to the filter.

@bryanyzhu
Copy link
Collaborator

Hi @blackmagicianZ , are you using the videos from the torrent website? If not, could you please open another issue and attach these videos? We can look into the issue of loading these videos. Thank you.

@bychen7
Copy link

bychen7 commented Jan 12, 2021

Hi @blackmagicianZ , are you using the videos from the torrent website? If not, could you please open another issue and attach these videos? We can look into the issue of loading these videos. Thank you.

Maybe some video didn't download successfully, I will download videos from the torrent website, if the videos from the torrent website still has problems, I will open another issue. Thank you.

@aaroncodebro
Copy link

I have tested the script half a year ago, but not recently. Thank you for pointing out the missing url issue, I will fix it.
In terms of generating k400_train.txt, once you download the videos from the torrent website (or you already have the data), you can use the following code to generate it.

import os
import sys

video_dir = '/home/ubuntu/data/kinetics400/train_256/'
classes = os.listdir(video_dir)
classes.sort()

anno_file = '/home/ubuntu/data/kinetics400/k400_train.txt'
f = open(anno_file, 'a')

class_id = 0
for each_class in classes:
    class_dir = os.path.join(video_dir, each_class)
    videos = os.listdir(class_dir)
    videos.sort()

    for each_video in videos:
        video_name = os.path.join(each_class, each_video)
        line_info = video_name + ' ' + str(300) + ' ' + str(class_id) + '\r\n'
        f.writelines(line_info)

    class_id += 1

Simply put, each video corresponds to one line in the txt file. There are three items in each line: video path, video duration and video label. Since our video reader can automatically get video duration information during video loading, we just need a placeholder 300 here to indicate the video duration (i.e., number of frames).

Thanks for your response, I have started training, but when reading with decord, some video cannot be loaded as following, did you know why or how could I solve it?

video cannot be loaded by decord:  /data/kinetics400/videos_train/throwing_axe/Yse3yBzFgPo_1_10.mp4
/action/gluon-cv/gluoncv/torch/data/video_cls/dataset_classification.py:122: UserWarning: video throwing_axe/Yse3yBzFgPo_1_10.mp4 not correctly loaded during training
  warnings.warn("video {} not correctly loaded during training".format(sample))
[buffer @ 0x5607ed561640] Unable to parse option value "-1" as pixel format
[buffer @ 0x5607ed561640] Unable to parse option value "-1" as pixel format
[buffer @ 0x5607ed561640] Error setting option pix_fmt to value -1.
[in @ 0x5607edbff1c0] Error applying options to the filter.

Hi @blackmagicianZ , did you manage to fix this ?. I have the same issue for my custom dataset.

@bychen7
Copy link

bychen7 commented Jul 13, 2021

I have tested the script half a year ago, but not recently. Thank you for pointing out the missing url issue, I will fix it.
In terms of generating k400_train.txt, once you download the videos from the torrent website (or you already have the data), you can use the following code to generate it.

import os
import sys

video_dir = '/home/ubuntu/data/kinetics400/train_256/'
classes = os.listdir(video_dir)
classes.sort()

anno_file = '/home/ubuntu/data/kinetics400/k400_train.txt'
f = open(anno_file, 'a')

class_id = 0
for each_class in classes:
    class_dir = os.path.join(video_dir, each_class)
    videos = os.listdir(class_dir)
    videos.sort()

    for each_video in videos:
        video_name = os.path.join(each_class, each_video)
        line_info = video_name + ' ' + str(300) + ' ' + str(class_id) + '\r\n'
        f.writelines(line_info)

    class_id += 1

Simply put, each video corresponds to one line in the txt file. There are three items in each line: video path, video duration and video label. Since our video reader can automatically get video duration information during video loading, we just need a placeholder 300 here to indicate the video duration (i.e., number of frames).

Thanks for your response, I have started training, but when reading with decord, some video cannot be loaded as following, did you know why or how could I solve it?

video cannot be loaded by decord:  /data/kinetics400/videos_train/throwing_axe/Yse3yBzFgPo_1_10.mp4
/action/gluon-cv/gluoncv/torch/data/video_cls/dataset_classification.py:122: UserWarning: video throwing_axe/Yse3yBzFgPo_1_10.mp4 not correctly loaded during training
  warnings.warn("video {} not correctly loaded during training".format(sample))
[buffer @ 0x5607ed561640] Unable to parse option value "-1" as pixel format
[buffer @ 0x5607ed561640] Unable to parse option value "-1" as pixel format
[buffer @ 0x5607ed561640] Error setting option pix_fmt to value -1.
[in @ 0x5607edbff1c0] Error applying options to the filter.

Hi @blackmagicianZ , did you manage to fix this ?. I have the same issue for my custom dataset.

This might some videos was broken, check your videos.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

6 participants