class_docstr: The base class to prepare data for mmlab models specified by "prefix".
  Child class shall provide its specific collate function in __init__.
class_docstr_tok: ["The","base","class","to","prepare","data","for","mmlab","models","specified","by","``","prefix","''",".","Child","class","shall","provide","its","specific","collate","function","in","__init__","."]
docstr: Collate images into a batch. Here it pads images since the image number may
  vary from sample to sample. Samples with less images will be padded zeros.
  The valid image numbers of samples will be stacked into a vector.
  This function will be used when creating Pytorch DataLoader.
  
  Returns
  -------
  A dictionary containing one model's collator function for image data.
docstr_tok: ["Collate","images","into","a","batch",".","Here","it","pads","images","since","the","image","number","may","vary","from","sample","to","sample",".","Samples","with","less","images","will","be","padded","zeros",".","The","valid","image","numbers","of","samples","will","be","stacked","into","a","vector",".","This","function","will","be","used","when","creating","Pytorch","DataLoader",".","Returns","--","--","--","-","A","dictionary","containing","one","model","'s","collator","function","for","image","data","."]
code: def collate_fn(
      self,
      image_column_names: Optional[List] = None,
      per_gpu_batch_size: Optional[int] = None,
  ) -> Dict:
      """
      Collate images into a batch. Here it pads images since the image number may
      vary from sample to sample. Samples with less images will be padded zeros.
      The valid image numbers of samples will be stacked into a vector.
      This function will be used when creating Pytorch DataLoader.
  
      Returns
      -------
      A dictionary containing one model's collator function for image data.
      """
  
      fn = {}
      if self.requires_column_info:
          assert image_column_names, "Empty image column names."
          for col_name in image_column_names:
              fn[
                  f"{self.image_column_prefix}_{col_name}"
              ] = StackCollator()
  
      fn.update(
          {
              self.image_key: self.collate_func(
                  samples_per_gpu=per_gpu_batch_size
              ),
          }
      )
  
      return fn
  
file_path: autogluon/multimodal/src/autogluon/multimodal/data/process_mmlab/process_mmlab_base.py
imports: import logging
  import warnings
  from typing import Callable, Dict, List, Optional, Union
  import numpy
  import PIL
  from PIL import ImageFile
  from torch import nn
  from ...constants import AUTOMM, COLUMN, IMAGE, IMAGE_VALID_NUM, MMDET_IMAGE
  from ..collator import StackCollator
  from ..utils import is_rois_input
label_desc: Use image node_id 5 for calling the MMLabProcessor obj's underlying member method code with example usage: obj.collate_fn(image_column_names, per_gpu_batch_size) and returns: fn