Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
fe4d17fc
"src/vscode:/vscode.git/clone" did not exist on "600cf1316aeee1ada38425d0dfdac637ebbad56b"
Unverified
Commit
fe4d17fc
authored
Jul 31, 2019
by
Francisco Massa
Committed by
GitHub
Jul 31, 2019
Browse files
Rename KineticsVideo to Kinetics400 (#1183)
Also add docs
parent
5c0b7f31
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
6 deletions
+45
-6
docs/source/datasets.rst
docs/source/datasets.rst
+8
-0
references/video_classification/train.py
references/video_classification/train.py
+2
-2
torchvision/datasets/__init__.py
torchvision/datasets/__init__.py
+2
-2
torchvision/datasets/kinetics.py
torchvision/datasets/kinetics.py
+33
-2
No files found.
docs/source/datasets.rst
View file @
fe4d17fc
...
...
@@ -200,3 +200,11 @@ USPS
.. autoclass:: USPS
:members: __getitem__
:special-members:
Kinetics-400
~~~~~
.. autoclass:: Kinetics400
:members: __getitem__
:special-members:
references/video_classification/train.py
View file @
fe4d17fc
...
...
@@ -139,7 +139,7 @@ def main(args):
if
args
.
distributed
:
print
(
"It is recommended to pre-compute the dataset cache "
"on a single-gpu first, as it will be faster"
)
dataset
=
torchvision
.
datasets
.
Kinetics
Video
(
dataset
=
torchvision
.
datasets
.
Kinetics
400
(
traindir
,
frames_per_clip
=
args
.
clip_len
,
step_between_clips
=
1
,
...
...
@@ -171,7 +171,7 @@ def main(args):
if
args
.
distributed
:
print
(
"It is recommended to pre-compute the dataset cache "
"on a single-gpu first, as it will be faster"
)
dataset_test
=
torchvision
.
datasets
.
Kinetics
Video
(
dataset_test
=
torchvision
.
datasets
.
Kinetics
400
(
valdir
,
frames_per_clip
=
args
.
clip_len
,
step_between_clips
=
1
,
...
...
torchvision/datasets/__init__.py
View file @
fe4d17fc
...
...
@@ -19,7 +19,7 @@ from .celeba import CelebA
from
.sbd
import
SBDataset
from
.vision
import
VisionDataset
from
.usps
import
USPS
from
.kinetics
import
Kinetics
Video
from
.kinetics
import
Kinetics
400
from
.hmdb51
import
HMDB51
from
.ucf101
import
UCF101
...
...
@@ -31,4 +31,4 @@ __all__ = ('LSUN', 'LSUNClass',
'Omniglot'
,
'SBU'
,
'Flickr8k'
,
'Flickr30k'
,
'VOCSegmentation'
,
'VOCDetection'
,
'Cityscapes'
,
'ImageNet'
,
'Caltech101'
,
'Caltech256'
,
'CelebA'
,
'SBDataset'
,
'VisionDataset'
,
'USPS'
,
'Kinetics
Video
'
,
'HMDB51'
,
'UCF101'
)
'USPS'
,
'Kinetics
400
'
,
'HMDB51'
,
'UCF101'
)
torchvision/datasets/kinetics.py
View file @
fe4d17fc
...
...
@@ -4,9 +4,40 @@ from .folder import make_dataset
from
.vision
import
VisionDataset
class
KineticsVideo
(
VisionDataset
):
class
Kinetics400
(
VisionDataset
):
"""
`Kinetics-400 <https://deepmind.com/research/open-source/open-source-datasets/kinetics/>`_
dataset.
Kinetics-400 is an action recognition video dataset.
This dataset consider every video as a collection of video clips of fixed size, specified
by ``frames_per_clip``, where the step in frames between each clip is given by
``step_between_clips``.
To give an example, for 2 videos with 10 and 15 frames respectively, if ``frames_per_clip=5``
and ``step_between_clips=5``, the dataset size will be (2 + 3) = 5, where the first two
elements will come from video 1, and the next three elements from video 2.
Note that we drop clips which do not have exactly ``frames_per_clip`` elements, so not all
frames in a video might be present.
Internally, it uses a VideoClips object to handle clip creation.
Args:
root (string): Root directory of the Kinetics-400 Dataset.
frames_per_clip (int): number of frames in a clip
step_between_clips (int): number of frames between each clip
transform (callable, optional): A function/transform that takes in a TxHxWxC video
and returns a transformed version.
Returns:
video (Tensor[T, H, W, C]): the `T` video frames
audio(Tensor[K, L]): the audio frames, where `K` is the number of channels
and `L` is the number of points
label (int): class of the video clip
"""
def
__init__
(
self
,
root
,
frames_per_clip
,
step_between_clips
=
1
,
transform
=
None
):
super
(
Kinetics
Video
,
self
).
__init__
(
root
)
super
(
Kinetics
400
,
self
).
__init__
(
root
)
extensions
=
(
'avi'
,)
classes
=
list
(
sorted
(
list_dir
(
root
)))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment