class_docstr: Visualize action predictions for videos or folder of images with precomputed
  and ground-truth boxes in AVA format.
class_docstr_tok: ["Visualize","action","predictions","for","videos","or","folder","of","images","with","precomputed","and","ground-truth","boxes","in","AVA","format","."]
docstr: Get input clip from the video/folder of images for a given
  keyframe index.
  Args:
      keyframe_idx (int): index of the current keyframe.
  Returns:
      clip (list of tensors): formatted input clip(s) corresponding to
          the current keyframe.
docstr_tok: ["Get","input","clip","from","the","video\/folder","of","images","for","a","given","keyframe","index",".","Args",":","keyframe_idx","(","int",")",":","index","of","the","current","keyframe",".","Returns",":","clip","(","list","of","tensors",")",":","formatted","input","clip","(","s",")","corresponding","to","the","current","keyframe","."]
code: def get_input_clip(self, keyframe_idx):
      """
      Get input clip from the video/folder of images for a given
      keyframe index.
      Args:
          keyframe_idx (int): index of the current keyframe.
      Returns:
          clip (list of tensors): formatted input clip(s) corresponding to
              the current keyframe.
      """
      seq = get_sequence(
          keyframe_idx,
          self.seq_length // 2,
          self.cfg.DATA.SAMPLING_RATE,
          self.total_frames,
      )
      clip = []
      for frame_idx in seq:
          self.cap.set(cv2.CAP_PROP_POS_FRAMES, frame_idx)
          was_read, frame = self.cap.read()
          if was_read:
              frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
              frame = scale(self.cfg.DATA.TEST_CROP_SIZE, frame)
              clip.append(frame)
          else:
              logger.error(
                  "Unable to read frame. Duplicating previous frame."
              )
              clip.append(clip[-1])
  
      clip = process_cv2_inputs(clip, self.cfg)
      return clip
  
imports: import numpy
  import os
  import cv2
  import torch
  import tqdm
  import slowfast.utils.checkpoint
  import slowfast.utils.logging
  from slowfast.datasets.ava_helper import parse_bboxes_file
  from slowfast.datasets.cv2_transform import scale, scale_boxes
  from slowfast.datasets.utils import get_sequence
  from slowfast.models import build_model
  from slowfast.utils import misc
  from slowfast.utils.env import pathmgr
  from slowfast.visualization.utils import process_cv2_inputs
  from slowfast.visualization.video_visualizer import VideoVisualizer
label_desc: Use image node_id 3 for calling the AVAVisualizerWithPrecomputedBox obj's underlying member method code with example usage: obj.get_input_clip(keyframe_idx) and returns: clip