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 postprocess(self, model_outputs, threshold=0.1, top_k=None):
      texts = model_outputs["text_queries"]
  
      outputs = self.feature_extractor.post_process(
          outputs=model_outputs,
          target_sizes=model_outputs["target_sizes"],
      )
  
      results = []
      for i in range(len(outputs)):
          keep = outputs[i]["scores"] >= threshold
          labels = outputs[i]["labels"][keep].tolist()
          scores = outputs[i]["scores"][keep].tolist()
          boxes = [
              self._get_bounding_box(box)
              for box in outputs[i]["boxes"][keep]
          ]
  
          result = [
              {"score": score, "label": texts[i][label], "box": box}
              for score, label, box in zip(scores, labels, boxes)
          ]
  
          result = sorted(
              result, key=lambda x: x["score"], reverse=True
          )
          if top_k:
              result = result[:top_k]
          results.append(result)
  
      return results
  
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 6 for calling the ZeroShotObjectDetectionPipeline obj's underlying member method code with example usage: obj.postprocess(model_outputs, threshold, top_k) and returns: results