code: def Hmdb51(
      data_path: pathlib.Path,
      clip_sampler: ClipSampler,
      video_sampler: Type[
          torch.utils.data.Sampler
      ] = torch.utils.data.RandomSampler,
      transform: Optional[Callable[[dict], Any]] = None,
      video_path_prefix: str = "",
      split_id: int = 1,
      split_type: str = "train",
      decode_audio=True,
      decoder: str = "pyav",
  ) -> LabeledVideoDataset:
      """
      A helper function to create ``LabeledVideoDataset`` object for HMDB51 dataset
  
      Args:
          data_path (pathlib.Path): Path to the data. The path type defines how the data
              should be read:
  
              * For a file path, the file is read and each line is parsed into a
                video path and label.
              * For a directory, the directory structure defines the classes
                (i.e. each subdirectory is a class).
  
          clip_sampler (ClipSampler): Defines how clips should be sampled from each
              video. See the clip sampling documentation for more information.
  
          video_sampler (Type[torch.utils.data.Sampler]): Sampler for the internal
              video container. This defines the order videos are decoded and,
              if necessary, the distributed split.
  
          transform (Callable): This callable is evaluated on the clip output before
              the clip is returned. It can be used for user defined preprocessing and
              augmentations to the clips. See the ``LabeledVideoDataset`` class for
              clip output format.
  
          video_path_prefix (str): Path to root directory with the videos that are
              loaded in LabeledVideoDataset. All the video paths before loading
              are prefixed with this path.
  
          split_id (int): Fold id to be loaded. Options are 1, 2 or 3
  
          split_type (str): Split/Fold type to be loaded. Options are ("train", "test" or
              "unused")
  
          decoder (str): Defines which backend should be used to decode videos.
      """
  
      torch._C._log_api_usage_once("PYTORCHVIDEO.dataset.Hmdb51")
  
      labeled_video_paths = Hmdb51LabeledVideoPaths.from_dir(
          data_path, split_id=split_id, split_type=split_type
      )
      labeled_video_paths.path_prefix = video_path_prefix
      dataset = LabeledVideoDataset(
          labeled_video_paths,
          clip_sampler,
          video_sampler,
          transform,
          decode_audio=decode_audio,
          decoder=decoder,
      )
  
      return dataset
  
file_path: pytorchvideo/pytorchvideo/data/hmdb51.py
imports: from __future__ import annotations
  import logging
  import os
  import pathlib
  from typing import Any, Callable, List, Optional, Tuple, Type, Union
  import torch
  import torch.utils.data
  from iopath.common.file_io import g_pathmgr
  from .clip_sampling import ClipSampler
  from .labeled_video_dataset import LabeledVideoDataset
label_desc: Use image node_id 1 for calling a global function with example usage: Hmdb51(data_path, clip_sampler, video_sampler, transform, video_path_prefix, split_id, split_type, decode_audio, decoder) and returns: dataset