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: Parameters
  ----------
  model
      The model using this data processor.
  collate_func
      The collate function to use for this processor
  max_img_num_per_col
      The maximum number of images one sample can have.
  missing_value_strategy
      How to deal with a missing image. We now support:
      - skip
          Skip this sample
      -zero
          Use an image with zero pixels.
  requires_column_info
      Whether to require feature column information in dataloader.
docstr_tok: ["Parameters","--","--","--","--","--","model","The","model","using","this","data","processor",".","collate_func","The","collate","function","to","use","for","this","processor","max_img_num_per_col","The","maximum","number","of","images","one","sample","can","have",".","missing_value_strategy","How","to","deal","with","a","missing","image",".","We","now","support",":","-","skip","Skip","this","sample","-zero","Use","an","image","with","zero","pixels",".","requires_column_info","Whether","to","require","feature","column","information","in","dataloader","."]
code: def __init__(
      self,
      model: nn.Module,
      max_img_num_per_col: Optional[int] = 1,
      missing_value_strategy: Optional[str] = "zero",
      requires_column_info: bool = False,
  ):
      """
      Parameters
      ----------
      model
          The model using this data processor.
      collate_func
          The collate function to use for this processor
      max_img_num_per_col
          The maximum number of images one sample can have.
      missing_value_strategy
          How to deal with a missing image. We now support:
          - skip
              Skip this sample
          -zero
              Use an image with zero pixels.
      requires_column_info
          Whether to require feature column information in dataloader.
      """
  
      self.prefix = model.prefix
      self.missing_value_strategy = missing_value_strategy
      self.requires_column_info = requires_column_info
  
      self.max_img_num_per_col = max_img_num_per_col
      if max_img_num_per_col <= 0:
          logger.debug(
              f"max_img_num_per_col {max_img_num_per_col} is reset to 1"
          )
          max_img_num_per_col = 1
      self.max_img_num_per_col = max_img_num_per_col
      logger.debug(f"max_img_num_per_col: {max_img_num_per_col}")
  
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 1 to create a new OVDProcessor object  with example: obj = OVDProcessor(model, max_img_num_per_col, missing_value_strategy, requires_column_info)