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: Return a clip of `num_frames` frames starting from `start_idx`. If not enough frames
  from `start_idx`, return the remaining frames from `start_idx`.
  Args:
      start_idx (int): starting idx.
      num_frames (int): number of frames in the returned clip.
docstr_tok: ["Return","a","clip","of","`","num_frames","`","frames","starting","from","`","start_idx","`",".","If","not","enough","frames","from","`","start_idx","`",",","return","the","remaining","frames","from","`","start_idx","`",".","Args",":","start_idx","(","int",")",":","starting","idx",".","num_frames","(","int",")",":","number","of","frames","in","the","returned","clip","."]
code: def _get_frame_range(self, start_idx, num_frames):
      """
      Return a clip of `num_frames` frames starting from `start_idx`. If not enough frames
      from `start_idx`, return the remaining frames from `start_idx`.
      Args:
          start_idx (int): starting idx.
          num_frames (int): number of frames in the returned clip.
      """
      was_read = True
      assert start_idx < self.total_frames, "Start index out of range."
  
      self.cap.set(cv2.CAP_PROP_POS_FRAMES, start_idx)
      all_frames = []
      for _ in range(num_frames):
          was_read, frame = self.cap.read()
          if was_read:
              all_frames.append(frame)
          else:
              break
  
      return all_frames
  
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 9 for calling the AVAVisualizerWithPrecomputedBox obj's underlying member method code with example usage: obj._get_frame_range(start_idx, num_frames) and returns: all_frames