class_docstr: This is the object detection class for images in the ImageAI library. It allows you to detect the 80 objects in the COCO dataset [ https://cocodataset.org/#home ] in any image. 
  
  This class provides support for RetinaNet, YOLOv3 and TinyYOLOv3 object detection networks . After instantiating this class, you can set its properties and make object detections using pretrained models.
  
  The following functions are required to be called before object detection can be made
  
  * setModelPath: Used to specify the filepath to the pretrained model.
  
  * At least of of the following and it must correspond to the model set in the setModelPath()
  [setModelTypeAsRetinaNet(), setModelTypeAsYOLOv3(), setModelTypeAsTinyYOLOv3()]
  
  * loadModel: [This must be called once only before performing object detection]
  Once the above functions have been called, you can call the detectObjectsFromImage() function of
  the object detection instance object at anytime to obtain observable objects in any image.
  
  * detectObjectsFromImage: Used to perform object detection on an image
class_docstr_tok: ["This","is","the","object","detection","class","for","images","in","the","ImageAI","library",".","It","allows","you","to","detect","the","80","objects","in","the","COCO","dataset","[","https",":","\/\/cocodataset.org\/","#","home","]","in","any","image",".","This","class","provides","support","for","RetinaNet",",","YOLOv3","and","TinyYOLOv3","object","detection","networks",".","After","instantiating","this","class",",","you","can","set","its","properties","and","make","object","detections","using","pretrained","models",".","The","following","functions","are","required","to","be","called","before","object","detection","can","be","made","*","setModelPath",":","Used","to","specify","the","filepath","to","the","pretrained","model",".","*","At","least","of","of","the","following","and","it","must","correspond","to","the","model","set","in","the","setModelPath","(",")","[","setModelTypeAsRetinaNet","(",")",",","setModelTypeAsYOLOv3","(",")",",","setModelTypeAsTinyYOLOv3","(",")","]","*","loadModel",":","[","This","must","be","called","once","only","before","performing","object","detection","]","Once","the","above","functions","have","been","called",",","you","can","call","the","detectObjectsFromImage","(",")","function","of","the","object","detection","instance","object","at","anytime","to","obtain","observable","objects","in","any","image",".","*","detectObjectsFromImage",":","Used","to","perform","object","detection","on","an","image"]
code: def __init__(self) -> None:
      self.__device: str = (
          "cuda" if torch.cuda.is_available() else "cpu"
      )
      self.__nms_score: float = 0.4
      self.__objectness_score: float = 0.5
      self.__anchors: List[int] = None
      self.__anchors_yolov3: List[int] = [
          10,
          13,
          16,
          30,
          33,
          23,
          30,
          61,
          62,
          45,
          59,
          119,
          116,
          90,
          156,
          198,
          373,
          326,
      ]
      self.__anchors_tiny_yolov3: List[int] = [
          10,
          14,
          23,
          27,
          37,
          58,
          81,
          82,
          135,
          169,
          344,
          319,
      ]
  
      self.__classes = self.__load_classes(
          os.path.join(
              os.path.dirname(os.path.abspath(__file__)),
              "coco_classes.txt",
          )
      )
      self.__model_type = ""
      self.__model = None
      self.__model_loaded = False
      self.__model_path = ""
  
imports: import os, warnings
  from tkinter import Image
  from collections import defaultdict
  from typing import List, Tuple, Dict, Union
  from PIL import Image
  import torchvision
  import numpy
  from enum import Enum
  import torch
  import cv2
  from typing import Union, List
  from ..yolov3.yolov3 import YoloV3
  from ..yolov3.tiny_yolov3 import YoloV3Tiny
  from ..yolov3.utils import draw_bbox_and_label, get_predictions, prepare_image
  from ..retinanet.utils import read_image, draw_bounding_boxes_and_labels, tensor_to_ndarray
  import uuid
  from ..backend_check.model_extension import extension_check
label_desc: Use image node_id 1 to create a new ObjectDetection object  with example: obj = ObjectDetection()