|
4 | 4 | from .vision import VisionDataset
|
5 | 5 |
|
6 | 6 |
|
7 |
| -class KineticsVideo(VisionDataset): |
| 7 | +class Kinetics400(VisionDataset): |
| 8 | + """ |
| 9 | + `Kinetics-400 <https://deepmind.com/research/open-source/open-source-datasets/kinetics/>`_ |
| 10 | + dataset. |
| 11 | +
|
| 12 | + Kinetics-400 is an action recognition video dataset. |
| 13 | + This dataset consider every video as a collection of video clips of fixed size, specified |
| 14 | + by ``frames_per_clip``, where the step in frames between each clip is given by |
| 15 | + ``step_between_clips``. |
| 16 | +
|
| 17 | + To give an example, for 2 videos with 10 and 15 frames respectively, if ``frames_per_clip=5`` |
| 18 | + and ``step_between_clips=5``, the dataset size will be (2 + 3) = 5, where the first two |
| 19 | + elements will come from video 1, and the next three elements from video 2. |
| 20 | + Note that we drop clips which do not have exactly ``frames_per_clip`` elements, so not all |
| 21 | + frames in a video might be present. |
| 22 | +
|
| 23 | + Internally, it uses a VideoClips object to handle clip creation. |
| 24 | +
|
| 25 | + Args: |
| 26 | + root (string): Root directory of the Kinetics-400 Dataset. |
| 27 | + frames_per_clip (int): number of frames in a clip |
| 28 | + step_between_clips (int): number of frames between each clip |
| 29 | + transform (callable, optional): A function/transform that takes in a TxHxWxC video |
| 30 | + and returns a transformed version. |
| 31 | +
|
| 32 | + Returns: |
| 33 | + video (Tensor[T, H, W, C]): the `T` video frames |
| 34 | + audio(Tensor[K, L]): the audio frames, where `K` is the number of channels |
| 35 | + and `L` is the number of points |
| 36 | + label (int): class of the video clip |
| 37 | + """ |
| 38 | + |
8 | 39 | def __init__(self, root, frames_per_clip, step_between_clips=1, transform=None):
|
9 |
| - super(KineticsVideo, self).__init__(root) |
| 40 | + super(Kinetics400, self).__init__(root) |
10 | 41 | extensions = ('avi',)
|
11 | 42 |
|
12 | 43 | classes = list(sorted(list_dir(root)))
|
|
0 commit comments