# Path: pycoral/adapters/common.py
# def output_tensor(interpreter, i):
# def input_details(interpreter, key):
# def input_size(interpreter):
# def input_tensor(interpreter):
# def set_input(interpreter, data):
# def set_resized_input(interpreter, size, resize):


import collections
from pycoral.adapters import common
                image_scale=(1.0, 1.0)):
  """Gets results from a detection model as a list of detected objects.

  Args:
    interpreter: The ``tf.lite.Interpreter`` to query for results.
    score_threshold (float): The score threshold for results. All returned
      results have a score greater-than-or-equal-to this value.
    image_scale (float, float): Scaling factor to apply to the bounding boxes as
      (x-scale-factor, y-scale-factor), where each factor is from 0 to 1.0.

  Returns:
    A list of :obj:`Object` objects, which each contains the detected object's
    id, score, and bounding box as :obj:`BBox`.
  """
  # If a model has signature, we use the signature output tensor names to parse
  # the results. Otherwise, we parse the results based on some assumption of the
  # output tensor order and size.
  # pylint: disable=protected-access
  signature_list = interpreter._get_full_signature_list()
  # pylint: enable=protected-access
  if signature_list:
    if len(signature_list) > 1:
      raise ValueError('Only support model with one signature.')
    signature = signature_list[next(iter(signature_list))]
    count = int(interpreter.tensor(signature['outputs']['output_0'])()[0])
    scores = interpreter.tensor(signature['outputs']['output_1'])()[0]
    class_ids = interpreter.tensor(signature['outputs']['output_2'])()[0]
    boxes = interpreter.tensor(signature['outputs']['output_3'])()[0]
  elif common.output_tensor(interpreter, 3).size == 1:
    boxes = common.output_tensor(interpreter, 0)[0]

# Path: pycoral/adapters/common.py
# def output_tensor(interpreter, i):
# def input_details(interpreter, key):
# def input_size(interpreter):
# def input_tensor(interpreter):
# def set_input(interpreter, data):
# def set_resized_input(interpreter, size, resize):


# Path: pycoral/adapters/detect.py
import collections
from pycoral.adapters import common

                image_scale=(1.0, 1.0)):
  """Gets results from a detection model as a list of detected objects.

  Args:
    interpreter: The ``tf.lite.Interpreter`` to query for results.
    score_threshold (float): The score threshold for results. All returned
      results have a score greater-than-or-equal-to this value.
    image_scale (float, float): Scaling factor to apply to the bounding boxes as
      (x-scale-factor, y-scale-factor), where each factor is from 0 to 1.0.

  Returns:
    A list of :obj:`Object` objects, which each contains the detected object's
    id, score, and bounding box as :obj:`BBox`.
  """
  # If a model has signature, we use the signature output tensor names to parse
  # the results. Otherwise, we parse the results based on some assumption of the
  # output tensor order and size.
  # pylint: disable=protected-access
  signature_list = interpreter._get_full_signature_list()
  # pylint: enable=protected-access
  if signature_list:
    if len(signature_list) > 1:
      raise ValueError('Only support model with one signature.')
    signature = signature_list[next(iter(signature_list))]
    count = int(interpreter.tensor(signature['outputs']['output_0'])()[0])
    scores = interpreter.tensor(signature['outputs']['output_1'])()[0]
    class_ids = interpreter.tensor(signature['outputs']['output_2'])()[0]
    boxes = interpreter.tensor(signature['outputs']['output_3'])()[0]
  elif common.output_tensor(interpreter, 3).size == 1:
    boxes = common.output_tensor(interpreter, 0)[0]

    class_ids = common.output_tensor(interpreter, 1)[0]