class_docstr: Prepare rois data for mmdetection models.
code: def prepare_one_sample(
      self,
      image_paths: Dict[str, List[str]],
      is_training: bool,
  ):
      mm_data = dict(img_prefix=None, bbox_fields=[])
  
      for per_col_name, per_col_content in image_paths.items():
          if is_rois_input(per_col_content):
              rois = np.array(per_col_content)
              # https://github.com/open-mmlab/mmdetection/blob/ecac3a77becc63f23d9f6980b2a36f86acd00a8a/mmdet/datasets/transforms/loading.py#L155
              mm_data["instances"] = []
              for roi in rois:
                  mm_data["instances"].append(
                      {
                          "bbox": roi[:4],
                          "bbox_label": roi[4],
                          "ignore_flag": 0,
                      }
                  )
          else:
              with PIL.Image.open(per_col_content[0]) as img:
                  # mm_data["img_info"] = dict(filename=per_col_content[0], height=img.height, width=img.width)
                  mm_data["img_path"] = per_col_content[0]
      if self.requires_column_info:
          pass  # TODO
  
      mm_data[
          "img_id"
      ] = 0  # TODO: use a non trivial image id for TTA (test time augmentation)
  
      return mm_data
  
file_path: autogluon/multimodal/src/autogluon/multimodal/data/process_mmlab/process_mmdet.py
imports: import logging
  from typing import Dict, List, Optional, Union
  import numpy
  import PIL
  from PIL import ImageFile
  from torch import nn
  from ..utils import is_rois_input
  from .process_mmlab_base import MMLabProcessor
label_desc: Use image node_id 2 for calling the MMDetProcessor obj's underlying member method code with example usage: obj.prepare_one_sample(image_paths, is_training) and returns: mm_data