docstr: vis_root (string): Root directory of images (e.g. coco/images/)
  ann_root (string): directory to store the annotation file
docstr_tok: ["vis_root","(","string",")",":","Root","directory","of","images","(","e.g",".","coco\/images\/",")","ann_root","(","string",")",":","directory","to","store","the","annotation","file"]
code: def __init__(
      self, vis_processor, text_processor, vis_root, ann_paths
  ):
      """
      vis_root (string): Root directory of images (e.g. coco/images/)
      ann_root (string): directory to store the annotation file
      """
  
      self.vis_root = vis_root
  
      self.annotation = []
      for ann_path in ann_paths:
          dialogs = json.load(open(ann_path, "r"))["dialogs"]
          for dialog in dialogs:
              all_turns = dialog["dialog"]
              dialogue_context = []
              for turn in all_turns:
                  dialog_instance = copy.deepcopy(dialog)
                  question = turn["question"]
                  answer = turn["answer"]
  
                  dialog_instance["dialog"] = copy.deepcopy(
                      dialogue_context
                  )
                  dialog_instance["question"] = question
                  dialog_instance["answer"] = answer
                  self.annotation.append(dialog_instance)
                  dialogue_context.append(turn)
  
      self.vis_processor = vis_processor
      self.text_processor = text_processor
  
      self._add_instance_ids()
  
      self.img_ids = {}
      n = 0
      for ann in self.annotation:
          img_id = ann["image_id"]
          if img_id not in self.img_ids.keys():
              self.img_ids[img_id] = n
              n += 1
  
file_path: lavis/lavis/datasets/datasets/dialogue_datasets.py
imports: import os
  from collections import OrderedDict
  from PIL import Image
  from lavis.datasets.datasets.base_dataset import BaseDataset
  import json
  import copy
label_desc: Use image node_id 1 to create a new DialogueDataset object from inherited base classes: BaseDataset, __DisplMixin with example: obj = DialogueDataset(vis_processor, text_processor, vis_root, ann_paths)