class_docstr: `Kinetics-400  <https://deepmind.com/research/open-source/
  open-source-datasets/kinetics/>`_ is an action recognition video dataset,
  and it has 400 classes.
  `Original publication <https://arxiv.org/pdf/1705.06950.pdf>`_
  
  We assume videos are already trimmed to 10-second clip, and are stored in a
  folder.
  
  It is built on top of `Kinetics <https://github.com/pytorch/vision/blob/
  master/torchvision/datasets/kinetics.py#L7/>`_ dataset class in TorchVision.
class_docstr_tok: ["`","Kinetics-400","<","https",":","\/\/deepmind.com\/research\/open-source\/","open-source-datasets\/kinetics\/",">","`","_","is","an","action","recognition","video","dataset",",","and","it","has","400","classes",".","`","Original","publication","<","https",":","\/\/arxiv.org\/pdf\/1705.06950.pdf",">","`","_","We","assume","videos","are","already","trimmed","to","10-second","clip",",","and","are","stored","in","a","folder",".","It","is","built","on","top","of","`","Kinetics","<","https",":","\/\/github.com\/pytorch\/vision\/blob\/","master\/torchvision\/datasets\/kinetics.py","#","L7\/",">","`","_","dataset","class","in","TorchVision","."]
docstr: Instantiates a Kinetics400Dataset from a configuration.
  
  Args:
      config: A configuration for a Kinetics400Dataset.
          See :func:`__init__` for parameters expected in the config.
  
  Returns:
      A Kinetics400Dataset instance.
docstr_tok: ["Instantiates","a","Kinetics400Dataset","from","a","configuration",".","Args",":","config",":","A","configuration","for","a","Kinetics400Dataset",".","See",":","func",":","`","__init__","`","for","parameters","expected","in","the","config",".","Returns",":","A","Kinetics400Dataset","instance","."]
code: def from_config(cls, config: Dict[str, Any]) -> "Kinetics400Dataset":
      """Instantiates a Kinetics400Dataset from a configuration.
  
      Args:
          config: A configuration for a Kinetics400Dataset.
              See :func:`__init__` for parameters expected in the config.
  
      Returns:
          A Kinetics400Dataset instance.
      """
      required_args = ["split", "metadata_file", "video_dir"]
      assert all(
          arg in config for arg in required_args
      ), f"The arguments {required_args} are all required."
  
      split = config["split"]
      audio_channels = config.get("audio_channels", 0)
      (
          transform_config,
          batchsize_per_replica,
          shuffle,
          num_samples,
          frames_per_clip,
          video_width,
          video_height,
          video_min_dimension,
          audio_samples,
          step_between_clips,
          frame_rate,
          clips_per_video,
      ) = cls.parse_config(config)
      extensions = config.get("extensions", ("mp4"))
  
      transform = build_video_field_transform_default(
          transform_config, split
      )
  
      return cls(
          split,
          batchsize_per_replica,
          shuffle,
          transform,
          num_samples,
          frames_per_clip,
          video_width,
          video_height,
          video_min_dimension,
          audio_samples,
          audio_channels,
          step_between_clips,
          frame_rate,
          clips_per_video,
          config["video_dir"],
          extensions,
          config["metadata_file"],
      )
  
file_path: ClassyVision/classy_vision/dataset/classy_kinetics400.py
imports: import os
  from typing import Any, Callable, Dict, List, Optional
  import torch
  from torchvision.datasets.kinetics import Kinetics
  from .None import register_dataset
  from .classy_video_dataset import ClassyVideoDataset
  from .transforms.util_video import build_video_field_transform_default
label_desc: Use image node_id 2 for calling the Kinetics400Dataset obj's underlying member method code with example usage: obj.from_config(cls, config) and returns: cls