class_docstr: Pre-processor for Hmbd51 dataset mentioned here -
      https://serre-lab.clps.brown.edu/resource/hmdb-a-large-human-motion-database/
  
  This dataset consists of classwise folds with each class consisting of 3
      folds (splits).
  
  The videos directory is of the format,
      video_dir_path/class_x/<somevideo_name>.avi
      ...
      video_dir_path/class_y/<somevideo_name>.avi
  
  The splits/fold directory is of the format,
      folds_dir_path/class_x_test_split_1.txt
      folds_dir_path/class_x_test_split_2.txt
      folds_dir_path/class_x_test_split_3.txt
      ...
      folds_dir_path/class_y_test_split_1.txt
      folds_dir_path/class_y_test_split_2.txt
      folds_dir_path/class_y_test_split_3.txt
  
  And each text file in the splits directory class_x_test_split_<1 or 2 or 3>.txt
      <a video as in video_dir_path/class_x> <0 or 1 or 2>
      where 0,1,2 corresponds to unused, train split respectively.
  
  Each video has name of format
      <some_name>_<tag1>_<tag2>_<tag_3>_<tag4>_<tag5>_<some_id>.avi
  For more details on tags -
      https://serre-lab.clps.brown.edu/resource/hmdb-a-large-human-motion-database/
class_docstr_tok: ["Pre-processor","for","Hmbd51","dataset","mentioned","here","-","https",":","\/\/serre-lab.clps.brown.edu\/resource\/hmdb-a-large-human-motion-database\/","This","dataset","consists","of","classwise","folds","with","each","class","consisting","of","3","folds","(","splits",")",".","The","videos","directory","is","of","the","format",",","video_dir_path\/class_x\/","<","somevideo_name",">",".avi","...","video_dir_path\/class_y\/","<","somevideo_name",">",".avi","The","splits\/fold","directory","is","of","the","format",",","folds_dir_path\/class_x_test_split_1.txt","folds_dir_path\/class_x_test_split_2.txt","folds_dir_path\/class_x_test_split_3.txt","...","folds_dir_path\/class_y_test_split_1.txt","folds_dir_path\/class_y_test_split_2.txt","folds_dir_path\/class_y_test_split_3.txt","And","each","text","file","in","the","splits","directory","class_x_test_split_","<","1","or","2","or","3",">",".txt","<","a","video","as","in","video_dir_path\/class_x",">","<","0","or","1","or","2",">","where","0,1,2","corresponds","to","unused",",","train","split","respectively",".","Each","video","has","name","of","format","<","some_name",">","_","<","tag1",">","_","<","tag2",">","_","<","tag_3",">","_","<","tag4",">","_","<","tag5",">","_","<","some_id",">",".avi","For","more","details","on","tags","-","https",":","\/\/serre-lab.clps.brown.edu\/resource\/hmdb-a-large-human-motion-database\/"]
docstr: Factory function that creates Hmdb51LabeledVideoPaths object form a list of
  split files of .txt type
  
  Args:
      file_paths (List[Union[pathlib.Path, str]]) : The path to the splits/folds
              directory of HMDB51.
      split_type (str): Split/Fold type to be loaded.
          - "train"
          - "test"
          - "unused"
docstr_tok: ["Factory","function","that","creates","Hmdb51LabeledVideoPaths","object","form","a","list","of","split","files","of",".txt","type","Args",":","file_paths","(","List","[","Union","[","pathlib.Path",",","str","]","]",")",":","The","path","to","the","splits\/folds","directory","of","HMDB51",".","split_type","(","str",")",":","Split\/Fold","type","to","be","loaded",".","-","``","train","''","-","``","test","''","-","``","unused","''"]
code: def from_csvs(
      cls,
      file_paths: List[Union[pathlib.Path, str]],
      split_type: str = "train",
  ) -> Hmdb51LabeledVideoPaths:
      """
      Factory function that creates Hmdb51LabeledVideoPaths object form a list of
      split files of .txt type
  
      Args:
          file_paths (List[Union[pathlib.Path, str]]) : The path to the splits/folds
                  directory of HMDB51.
          split_type (str): Split/Fold type to be loaded.
              - "train"
              - "test"
              - "unused"
      """
      video_paths_and_label = []
      for file_path in file_paths:
          file_path = pathlib.Path(file_path)
          assert g_pathmgr.exists(file_path), f"{file_path} not found."
          if not (
              file_path.suffix == ".txt"
              and "_test_split" in file_path.stem
          ):
              return RuntimeError(f"Ivalid file: {file_path}")
  
          action_name = "_"
          action_name = action_name.join(
              (file_path.stem).split("_")[:-2]
          )
          with g_pathmgr.open(file_path, "r") as f:
              for path_label in f.read().splitlines():
                  line_split = path_label.rsplit(None, 1)
  
                  if (
                      not int(line_split[1])
                      == cls._split_type_dict[split_type]
                  ):
                      continue
  
                  file_path = os.path.join(action_name, line_split[0])
                  meta_tags = line_split[0].split("_")[-6:-1]
                  video_paths_and_label.append(
                      (
                          file_path,
                          {
                              "label": action_name,
                              "meta_tags": meta_tags,
                          },
                      )
                  )
  
      assert (
          len(video_paths_and_label) > 0
      ), f"Failed to load dataset from {file_path}."
      return cls(video_paths_and_label)
  
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 2 for calling the Hmdb51LabeledVideoPaths obj's underlying member method code with example usage: obj.from_csvs(cls, file_paths, split_type) and returns: cls, RuntimeError