gluon-cv icon indicating copy to clipboard operation
gluon-cv copied to clipboard

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

Open yxchng opened this issue 4 years ago • 14 comments

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.

yxchng avatar Dec 31 '20 11:12 yxchng

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 avatar Dec 31 '20 18:12 bryanyzhu

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...

irvingzhang0512 avatar Jan 01 '21 03:01 irvingzhang0512

@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?

yxchng avatar Jan 01 '21 05:01 yxchng

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

irvingzhang0512 avatar Jan 01 '21 05:01 irvingzhang0512

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.

irvingzhang0512 avatar Jan 01 '21 11:01 irvingzhang0512

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…

StevenJokess avatar Jan 07 '21 16:01 StevenJokess

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.

bryanyzhu avatar Jan 07 '21 20:01 bryanyzhu

@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!

bychen7 avatar Jan 11 '21 13:01 bychen7

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).

bryanyzhu avatar Jan 11 '21 18:01 bryanyzhu

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.

bychen7 avatar Jan 12 '21 06:01 bychen7

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.

bryanyzhu avatar Jan 12 '21 07:01 bryanyzhu

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.

bychen7 avatar Jan 12 '21 08:01 bychen7

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.

aaroncodebro avatar Jul 09 '21 15:07 aaroncodebro

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.

bychen7 avatar Jul 13 '21 12:07 bychen7