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
f0148413
Unverified
Commit
f0148413
authored
Apr 27, 2022
by
Nicolas Hug
Committed by
GitHub
Apr 27, 2022
Browse files
Add revamped docs for video classification models (#5894)
* Add revamped docs for video classification models * EOL
parent
36c46357
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
96 additions
and
21 deletions
+96
-21
docs/source/conf.py
docs/source/conf.py
+1
-0
docs/source/models/video_resnet.rst
docs/source/models/video_resnet.rst
+26
-0
docs/source/models_new.rst
docs/source/models_new.rst
+21
-0
torchvision/models/video/resnet.py
torchvision/models/video/resnet.py
+48
-21
No files found.
docs/source/conf.py
View file @
f0148413
...
...
@@ -379,6 +379,7 @@ generate_weights_table(module=M.detection, table_name="detection", metrics=[("bo
generate_weights_table
(
module
=
M
.
segmentation
,
table_name
=
"segmentation"
,
metrics
=
[(
"miou"
,
"Mean IoU"
),
(
"pixel_acc"
,
"pixelwise Acc"
)]
)
generate_weights_table
(
module
=
M
.
video
,
table_name
=
"video"
,
metrics
=
[(
"acc@1"
,
"Acc@1"
),
(
"acc@5"
,
"Acc@5"
)])
def
setup
(
app
):
...
...
docs/source/models/video_resnet.rst
0 → 100644
View file @
f0148413
Video ResNet
============
.. currentmodule:: torchvision.models.video
The VideoResNet model is based on the `A Closer Look at Spatiotemporal
Convolutions for Action Recognition <https://arxiv.org/abs/1711.11248>`__ paper.
Model builders
--------------
The following model builders can be used to instantiate a VideoResNet model, with or
without pre-trained weights. All the model builders internally rely on the
``torchvision.models.video.resnet.VideoResNet`` base class. Please refer to the `source
code
<https://github.com/pytorch/vision/blob/main/torchvision/models/video/resnet.py>`_ for
more details about this class.
.. autosummary::
:toctree: generated/
:template: function.rst
r3d_18
mc3_18
r2plus1d_18
docs/source/models_new.rst
View file @
f0148413
...
...
@@ -101,3 +101,24 @@ Table of all available detection weights
Box MAPs are reported on COCO
.. include:: generated/detection_table.rst
Video Classification
====================
.. currentmodule:: torchvision.models.video
The following video classification models are available, with or without
pre-trained weights:
.. toctree::
:maxdepth: 1
models/video_resnet
Table of all available video classification weights
---------------------------------------------------
Accuracies are reported on Kinetics-400
.. include:: generated/video_table.rst
torchvision/models/video/resnet.py
View file @
f0148413
...
...
@@ -365,15 +365,24 @@ class R2Plus1D_18_Weights(WeightsEnum):
@
handle_legacy_interface
(
weights
=
(
"pretrained"
,
R3D_18_Weights
.
KINETICS400_V1
))
def
r3d_18
(
*
,
weights
:
Optional
[
R3D_18_Weights
]
=
None
,
progress
:
bool
=
True
,
**
kwargs
:
Any
)
->
VideoResNet
:
"""Construct 18 layer Resnet3D model as in
https://arxiv.org/abs/1711.11248
"""Construct 18 layer Resnet3D model.
Args:
weights (R3D_18_Weights, optional): The pretrained weights for the model
progress (bool): If True, displays a progress bar of the download to stderr
Reference: `A Closer Look at Spatiotemporal Convolutions for Action Recognition <https://arxiv.org/abs/1711.11248>`__.
Returns:
VideoResNet: R3D-18 network
Args:
weights (:class:`~torchvision.models.video.R3D_18_Weights`, optional): The
pretrained weights to use. See
:class:`~torchvision.models.video.R3D_18_Weights`
below for more details, and possible values. By default, no
pre-trained weights are used.
progress (bool): If True, displays a progress bar of the download to stderr. Default is True.
**kwargs: parameters passed to the ``torchvision.models.video.resnet.VideoResNet`` base class.
Please refer to the `source code
<https://github.com/pytorch/vision/blob/main/torchvision/models/video/resnet.py>`_
for more details about this class.
.. autoclass:: torchvision.models.video.R3D_18_Weights
:members:
"""
weights
=
R3D_18_Weights
.
verify
(
weights
)
...
...
@@ -390,15 +399,24 @@ def r3d_18(*, weights: Optional[R3D_18_Weights] = None, progress: bool = True, *
@
handle_legacy_interface
(
weights
=
(
"pretrained"
,
MC3_18_Weights
.
KINETICS400_V1
))
def
mc3_18
(
*
,
weights
:
Optional
[
MC3_18_Weights
]
=
None
,
progress
:
bool
=
True
,
**
kwargs
:
Any
)
->
VideoResNet
:
"""Constructor for 18 layer Mixed Convolution network as in
https://arxiv.org/abs/1711.11248
"""Construct 18 layer Mixed Convolution network as in
Args:
weights (MC3_18_Weights, optional): The pretrained weights for the model
progress (bool): If True, displays a progress bar of the download to stderr
Reference: `A Closer Look at Spatiotemporal Convolutions for Action Recognition <https://arxiv.org/abs/1711.11248>`__.
Returns:
VideoResNet: MC3 Network definition
Args:
weights (:class:`~torchvision.models.video.MC3_18_Weights`, optional): The
pretrained weights to use. See
:class:`~torchvision.models.video.MC3_18_Weights`
below for more details, and possible values. By default, no
pre-trained weights are used.
progress (bool): If True, displays a progress bar of the download to stderr. Default is True.
**kwargs: parameters passed to the ``torchvision.models.video.resnet.VideoResNet`` base class.
Please refer to the `source code
<https://github.com/pytorch/vision/blob/main/torchvision/models/video/resnet.py>`_
for more details about this class.
.. autoclass:: torchvision.models.video.MC3_18_Weights
:members:
"""
weights
=
MC3_18_Weights
.
verify
(
weights
)
...
...
@@ -415,15 +433,24 @@ def mc3_18(*, weights: Optional[MC3_18_Weights] = None, progress: bool = True, *
@
handle_legacy_interface
(
weights
=
(
"pretrained"
,
R2Plus1D_18_Weights
.
KINETICS400_V1
))
def
r2plus1d_18
(
*
,
weights
:
Optional
[
R2Plus1D_18_Weights
]
=
None
,
progress
:
bool
=
True
,
**
kwargs
:
Any
)
->
VideoResNet
:
"""Constructor for the 18 layer deep R(2+1)D network as in
https://arxiv.org/abs/1711.11248
"""Construct 18 layer deep R(2+1)D network as in
Args:
weights (R2Plus1D_18_Weights, optional): The pretrained weights for the model
progress (bool): If True, displays a progress bar of the download to stderr
Reference: `A Closer Look at Spatiotemporal Convolutions for Action Recognition <https://arxiv.org/abs/1711.11248>`__.
Returns:
VideoResNet: R(2+1)D-18 network
Args:
weights (:class:`~torchvision.models.video.R2Plus1D_18_Weights`, optional): The
pretrained weights to use. See
:class:`~torchvision.models.video.R2Plus1D_18_Weights`
below for more details, and possible values. By default, no
pre-trained weights are used.
progress (bool): If True, displays a progress bar of the download to stderr. Default is True.
**kwargs: parameters passed to the ``torchvision.models.video.resnet.VideoResNet`` base class.
Please refer to the `source code
<https://github.com/pytorch/vision/blob/main/torchvision/models/video/resnet.py>`_
for more details about this class.
.. autoclass:: torchvision.models.video.R2Plus1D_18_Weights
:members:
"""
weights
=
R2Plus1D_18_Weights
.
verify
(
weights
)
...
...
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