class_docstr: Zero shot object detection pipeline using `OwlViTForObjectDetection`. This pipeline predicts bounding boxes of
  objects when you provide an image and a set of `candidate_labels`.
  
  This object detection pipeline can currently be loaded from [`pipeline`] using the following task identifier:
  `"zero-shot-object-detection"`.
  
  See the list of available models on
  [huggingface.co/models](https://huggingface.co/models?filter=zero-shot-object-detection).
class_docstr_tok: ["Zero","shot","object","detection","pipeline","using","`","OwlViTForObjectDetection","`",".","This","pipeline","predicts","bounding","boxes","of","objects","when","you","provide","an","image","and","a","set","of","`","candidate_labels","`",".","This","object","detection","pipeline","can","currently","be","loaded","from","[","`","pipeline","`","]","using","the","following","task","identifier",":","`","``","zero-shot-object-detection","''","`",".","See","the","list","of","available","models","on","[","huggingface.co\/models","]","(","https",":","\/\/huggingface.co\/models","?","filter=zero-shot-object-detection",")","."]
code: def preprocess(self, inputs):
      if not isinstance(inputs["images"], List):
          inputs["images"] = [inputs["images"]]
      images = [load_image(img) for img in inputs["images"]]
      text_queries = inputs["text_queries"]
      if isinstance(text_queries, str) or isinstance(
          text_queries[0], str
      ):
          text_queries = [text_queries]
  
      target_sizes = [
          torch.IntTensor([[img.height, img.width]]) for img in images
      ]
      target_sizes = torch.cat(target_sizes)
      inputs = self._processor(
          text=inputs["text_queries"],
          images=images,
          return_tensors="pt",
      )
      return {
          "target_sizes": target_sizes,
          "text_queries": text_queries,
          **inputs,
      }
  
file_path: H2O/h2o_flexgen/benchmark/third_party/transformers/src/transformers/pipelines/zero_shot_object_detection.py
imports: from typing import Dict, List, Union
  import numpy
  from ..tokenization_utils_base import BatchEncoding
  from ..utils import add_end_docstrings, is_tf_available, is_torch_available, is_vision_available, logging, requires_backends
  from .base import PIPELINE_INIT_ARGS, Pipeline
label_desc: Use image node_id 4 for calling the ZeroShotObjectDetectionPipeline obj's underlying member method code with example usage: obj.preprocess(inputs) and returns: dict