class_docstr: Wrapper for Ego4D IMU data loads, assuming one csv per video_uid at the provided path.
docstr: Args:
      imu_path (str):
          Base path to construct IMU csv file paths.
          i.e. <base_path>/<video_uid>.csv
code: def __init__(self, imu_path: str) -> None:
      """
      Args:
          imu_path (str):
              Base path to construct IMU csv file paths.
              i.e. <base_path>/<video_uid>.csv
      """
      assert imu_path
  
      self.path_imu = imu_path
      self.IMU_by_video_uid: Dict[str, Any] = {}
      for f in g_pathmgr.ls(self.path_imu):
          self.IMU_by_video_uid[f.split(".")[0]] = f.replace(".csv", "")
  
      log.info(
          f"Number of videos with IMU (before filtering) {len(self.IMU_by_video_uid)}"
      )
  
      self.imu_video_uid: Optional[str] = None
      self.imu_video_data: Optional[
          Tuple[np.ndarray, np.ndarray, int]
      ] = None
  
imports: import csv
  import json
  import logging
  import os
  from bisect import bisect_left
  from collections import defaultdict
  from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type
  import numpy
  import torch
  import torch.autograd.profiler
  import torch.utils.data
  import torchaudio
  from iopath.common.file_io import g_pathmgr
  from pytorchvideo.data import LabeledVideoDataset
  from pytorchvideo.data.clip_sampling import ClipSampler
  from pytorchvideo.data.ego4d.utils import Ego4dImuDataBase, get_label_id_map, MomentsClipSampler
  from pytorchvideo.data.utils import get_logger
  from pytorchvideo.data.video import VideoPathHandler
  from pytorchvideo.transforms import ApplyTransformToKey, Div255, Normalize, RandomShortSideScale, ShortSideScale
  from torchvision.transforms import CenterCrop, Compose, RandomCrop, RandomHorizontalFlip
label_desc: Use image node_id 1 to create a new Ego4dImuData object from inherited base classes: Ego4dImuDataBase with example: obj = Ego4dImuData(imu_path)