class_docstr: Support MMOCR object detection models.
  Refer to https://github.com/open-mmlab/mmocr
docstr: Parameters
  ----------
  batch
      A dictionary containing the input mini-batch data.
      We need to use the keys with the model prefix to index required data.
  
  Returns
  -------
      A dictionary with bounding boxes.
docstr_tok: ["Parameters","--","--","--","--","--","batch","A","dictionary","containing","the","input","mini-batch","data",".","We","need","to","use","the","keys","with","the","model","prefix","to","index","required","data",".","Returns","--","--","--","-","A","dictionary","with","bounding","boxes","."]
code: def forward(
      self,
      batch: dict,
  ):
      """
      Parameters
      ----------
      batch
          A dictionary containing the input mini-batch data.
          We need to use the keys with the model prefix to index required data.
  
      Returns
      -------
          A dictionary with bounding boxes.
      """
  
      data = batch[self.image_key]
      # single image
      data["img_metas"] = [
          img_metas.data[0] for img_metas in data["img_metas"]
      ]
      data["img"] = [img.data[0] for img in data["img"]]
  
      device = next(self.model.parameters()).device  # model device
      if next(self.model.parameters()).is_cuda:
          # scatter to specified GPU
          data = scatter(data, [device])[0]
  
      results = self.model(return_loss=False, rescale=True, **data)
  
      ret = {BBOX: results[0]["boundary_result"]}
      return {self.prefix: ret}
  
file_path: autogluon/multimodal/src/autogluon/multimodal/models/mmocr_text_detection.py
imports: import logging
  from typing import Optional
  from torch import nn
  from ..constants import AUTOMM, BBOX, COLUMN, COLUMN_FEATURES, FEATURES, IMAGE, IMAGE_VALID_NUM, LABEL, LOGITS, MASKS
  from .utils import assign_layer_ids, get_column_features, get_mmocr_config_and_model, get_model_head
label_desc: Use image node_id 7 for calling the MMOCRAutoModelForTextDetection obj's underlying member method code with example usage: obj.forward(batch) and returns: dict