class_docstr: interface to Image Captioner
docstr: ```
  Object detection constructor
  
  Args:
    device(str): device to use (e.g., 'cuda', 'cpu')
    threshold(float):  threshold for object detection
    classification(bool): If True, simpy do image classification
  ```
docstr_tok: ["``","`","Object","detection","constructor","Args",":","device","(","str",")",":","device","to","use","(","e.g.",",","'cuda","'",",","'cpu","'",")","threshold","(","float",")",":","threshold","for","object","detection","classification","(","bool",")",":","If","True",",","simpy","do","image","classification","``","`"]
code: def __init__(self, device=None, classification=False, threshold=0.9):
      """
      ```
      Object detection constructor
  
      Args:
        device(str): device to use (e.g., 'cuda', 'cpu')
        threshold(float):  threshold for object detection
        classification(bool): If True, simpy do image classification
      ```
      """
      if not I.PIL_INSTALLED:
          raise Exception(
              "PIL is not installed. Please install with: pip install pillow>=9.0.1"
          )
  
      super().__init__(
          device=device,
          quantize=False,
          min_transformers_version="4.12.3",
      )
      self.pipeline = pipeline(
          "image-classification"
          if classification
          else "object-detection",
          device=self.device_to_id(),
      )
      self.threshold = threshold
      self.classification = classification
  
imports: from transformers import pipeline
  from ...None import imports
  from ...torch_base import TorchBase
label_desc: Use image node_id 1 to create a new ObjectDetector object from inherited base classes: TorchBase with example: obj = ObjectDetector(device, classification, threshold)