class_docstr: Pre-processor for Ava Actions Dataset stored as image frames -
      `<https://research.google.com/ava/download.html>_`
  This class handles the parsing of all the necessary
  csv files containing frame paths and frame labels.
class_docstr_tok: ["Pre-processor","for","Ava","Actions","Dataset","stored","as","image","frames","-","`","<","https",":","\/\/research.google.com\/ava\/download.html",">","_","`","This","class","handles","the","parsing","of","all","the","necessary","csv","files","containing","frame","paths","and","frame","labels","."]
docstr: Args:
      frame_labels_file (str): Path to the file containing containing labels
          per key frame. Acceptible file formats are,
          Type 1:
              <original_vido_id, frame_time_stamp, bbox_x_1, bbox_y_1, ...
              bbox_x_2, bbox_y_2, action_lable, detection_iou>
          Type 2:
              <original_vido_id, frame_time_stamp, bbox_x_1, bbox_y_1, ...
              bbox_x_2, bbox_y_2, action_lable, person_label>
      frame_paths_file (str): Path to a file containing relative paths
          to all the frames in the video. Each line in the file is of the
          form <original_vido_id video_id frame_id rel_path labels>
      video_path_prefix (str): Path to be augumented to the each relative frame
          path to get the global frame path.
      label_map_file (str): Path to a .pbtxt containing class id's and class names.
          If not set, label_map is not loaded and bbox labels are not pruned
          based on allowable class_id's in label_map.
  Returs:
      A list of tuples of the the form (video_frames directory, label dictionary).
docstr_tok: ["Args",":","frame_labels_file","(","str",")",":","Path","to","the","file","containing","containing","labels","per","key","frame",".","Acceptible","file","formats","are",",","Type","1",":","<","original_vido_id",",","frame_time_stamp",",","bbox_x_1",",","bbox_y_1",",","...","bbox_x_2",",","bbox_y_2",",","action_lable",",","detection_iou",">","Type","2",":","<","original_vido_id",",","frame_time_stamp",",","bbox_x_1",",","bbox_y_1",",","...","bbox_x_2",",","bbox_y_2",",","action_lable",",","person_label",">","frame_paths_file","(","str",")",":","Path","to","a","file","containing","relative","paths","to","all","the","frames","in","the","video",".","Each","line","in","the","file","is","of","the","form","<","original_vido_id","video_id","frame_id","rel_path","labels",">","video_path_prefix","(","str",")",":","Path","to","be","augumented","to","the","each","relative","frame","path","to","get","the","global","frame","path",".","label_map_file","(","str",")",":","Path","to","a",".pbtxt","containing","class","id","'s","and","class","names",".","If","not","set",",","label_map","is","not","loaded","and","bbox","labels","are","not","pruned","based","on","allowable","class_id","'s","in","label_map",".","Returs",":","A","list","of","tuples","of","the","the","form","(","video_frames","directory",",","label","dictionary",")","."]
code: def from_csv(
      cls,
      frame_paths_file: str,
      frame_labels_file: str,
      video_path_prefix: str,
      label_map_file: Optional[str] = None,
  ) -> AvaLabeledVideoFramePaths:
      """
      Args:
          frame_labels_file (str): Path to the file containing containing labels
              per key frame. Acceptible file formats are,
              Type 1:
                  <original_vido_id, frame_time_stamp, bbox_x_1, bbox_y_1, ...
                  bbox_x_2, bbox_y_2, action_lable, detection_iou>
              Type 2:
                  <original_vido_id, frame_time_stamp, bbox_x_1, bbox_y_1, ...
                  bbox_x_2, bbox_y_2, action_lable, person_label>
          frame_paths_file (str): Path to a file containing relative paths
              to all the frames in the video. Each line in the file is of the
              form <original_vido_id video_id frame_id rel_path labels>
          video_path_prefix (str): Path to be augumented to the each relative frame
              path to get the global frame path.
          label_map_file (str): Path to a .pbtxt containing class id's and class names.
              If not set, label_map is not loaded and bbox labels are not pruned
              based on allowable class_id's in label_map.
      Returs:
          A list of tuples of the the form (video_frames directory, label dictionary).
      """
      if label_map_file is not None:
          (
              _,
              allowed_class_ids,
          ) = AvaLabeledVideoFramePaths.read_label_map(label_map_file)
      else:
          allowed_class_ids = None
  
      (
          image_paths,
          video_idx_to_name,
          video_name_to_idx,
      ) = AvaLabeledVideoFramePaths.load_image_lists(
          frame_paths_file, video_path_prefix
      )
  
      video_frame_labels = (
          AvaLabeledVideoFramePaths.load_and_parse_labels_csv(
              frame_labels_file,
              video_name_to_idx,
              allowed_class_ids,
          )
      )
  
      # Populate keyframes list
      labeled_video_paths = []
      for video_id in video_frame_labels.keys():
          for frame_video_sec in video_frame_labels[video_id].keys():
              labels = video_frame_labels[video_id][frame_video_sec]
              if len(labels["labels"]) > 0:
                  labels = AvaLabeledVideoFramePaths._aggregate_bboxes_labels(
                      labels
                  )
                  labels["video_index"] = video_id
                  labels["clip_index"] = frame_video_sec
                  video_frames_dir = os.path.dirname(
                      image_paths[video_id][0]
                  )
                  labeled_video_paths.append((video_frames_dir, labels))
  
      return labeled_video_paths
  
file_path: pytorchvideo/pytorchvideo/data/ava.py
imports: from __future__ import annotations
  import os
  from collections import defaultdict
  from typing import Any, Callable, Dict, Optional, Set, Tuple, Type
  import torch
  from iopath.common.file_io import g_pathmgr
  from pytorchvideo.data.clip_sampling import ClipInfo, ClipSampler
  from pytorchvideo.data.labeled_video_dataset import LabeledVideoDataset
label_desc: Use image node_id 2 for calling the AvaLabeledVideoFramePaths obj's underlying member method code with example usage: obj.from_csv(cls, frame_paths_file, frame_labels_file, video_path_prefix, label_map_file) and returns: labeled_video_paths