code: def __init__(self, **kwargs):
      super().__init__(
          kwargs["vis_processor"],
          kwargs["text_processor"],
          kwargs["vis_root"],
          kwargs["ann_paths"],
      )
  
      self.modalities = kwargs["modalities"]
  
      for modality in self.modalities:
          if "image" in modality:
              setattr(
                  self,
                  f"existing_{modality}_annotation",
                  getattr(
                      self, f"get_existing_{modality}_annotations"
                  )(),
              )
              continue
          setattr(self, f"{modality}_root", kwargs[f"{modality}_root"])
          setattr(
              self,
              f"{modality}_processor",
              kwargs[f"{modality}_processor"],
          )
          setattr(
              self,
              f"existing_{modality}_annotation",
              getattr(self, f"get_existing_{modality}_annotations")(),
          )
      self.sample_ids = set.intersection(
          *[
              set(getattr(self, f"existing_{modality}_annotation"))
              for modality in self.modalities
          ]
      )
      self.annotation = [
          ann
          for ann in self.annotation
          if ann["youtube_id"] in self.sample_ids
      ]
  
file_path: lavis/lavis/datasets/datasets/yt8m_video_dialogue_datasets.py
imports: import torch
  import os
  import copy
  import random
  from PIL import Image
  from lavis.datasets.datasets.base_dataset import BaseDataset
label_desc: Use image node_id 1 to create a new YT8MDialDataset object from inherited base classes: BaseDataset with example: obj = YT8MDialDataset()