Shortcuts

mc3_18

torchvision.models.video.mc3_18(*, weights: Optional[torchvision.models.video.resnet.MC3_18_Weights] = None, progress: bool = True, **kwargs: Any)torchvision.models.video.resnet.VideoResNet[source]

Construct 18 layer Mixed Convolution network as in

Warning

The video module is in Beta stage, and backward compatibility is not guaranteed.

Reference: A Closer Look at Spatiotemporal Convolutions for Action Recognition.

Parameters
  • weights (MC3_18_Weights, optional) – The pretrained weights to use. See 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 for more details about this class.

class torchvision.models.video.MC3_18_Weights(value)[source]

The model builder above accepts the following values as the weights parameter. MC3_18_Weights.DEFAULT is equivalent to MC3_18_Weights.KINETICS400_V1. You can also use strings, e.g. weights='DEFAULT' or weights='KINETICS400_V1'.

MC3_18_Weights.KINETICS400_V1:

These weights reproduce closely the accuracy of the paper for 16-frame clip inputs. Also available as MC3_18_Weights.DEFAULT.

acc@1 (on Kinetics-400)

53.9

acc@5 (on Kinetics-400)

76.29

min_size

height=1, width=1

categories

abseiling, air drumming, answering questions, … (397 omitted)

recipe

link

num_params

11695440

The inference transforms are available at MC3_18_Weights.KINETICS400_V1.transforms and perform the following preprocessing operations: Accepts batched (B, T, C, H, W) and single (T, C, H, W) video frame torch.Tensor objects. The frames are resized to resize_size=[128, 171] using interpolation=InterpolationMode.BILINEAR, followed by a central crop of crop_size=[112, 112]. Finally the values are first rescaled to [0.0, 1.0] and then normalized using mean=[0.43216, 0.394666, 0.37645] and std=[0.22803, 0.22145, 0.216989]. Finally the output dimensions are permuted to (..., C, T, H, W) tensors.

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources