class_docstr: Prepare data for open vocabulary detection models specified by "prefix".
class_docstr_tok: ["Prepare","data","for","open","vocabulary","detection","models","specified","by","``","prefix","''","."]
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:
          return NotImplementedError(
              f"requires_column_info={self.requires_column_info} not implemented for OVD tasks."
          )
  
      fn.update(
          {
              self.image_key: PadCollator(pad_val=0),
              self.prompt_key: ListCollator(),
              self.image_meta_key: ListCollator(),
          }
      )
      return fn
  
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 COLUMN, IMAGE, IMAGE_META, IMAGE_VALID_NUM, PROMPT, TEXT
  from .collator import ListCollator, PadCollator
  from .utils import is_rois_input
label_desc: Use image node_id 7 for calling the OVDProcessor obj's underlying member method code with example usage: obj.collate_fn(image_column_names, per_gpu_batch_size) and returns: fn, NotImplementedError