def METHOD_NAME(self, frame):
    # The input needs to be a tensor, convert it using `tf.convert_to_tensor`.
    input_tensor = tf.convert_to_tensor(frame.pixels)
    # The model expects a batch of images, so add an axis with `tf.newaxis`.
    input_tensor = input_tensor[tf.newaxis, ...]
    # Perform detection
    output_dict = self._detect_fn(input_tensor)
    # All outputs are batches tensors.
    # Convert to numpy arrays, and take index [0] to remove the batch dimension.
    # We're only interested in the first num_detections.
    num_detections = int(output_dict.pop('num_detections'))
    output_dict = {key: value[0, :num_detections].numpy()
                   for key, value in output_dict.items()}
    # Extract classes, boxes and scores
    classes = output_dict['detection_classes'].astype(np.int64)  # classes should be ints.
    boxes = output_dict['detection_boxes']
    scores = output_dict['detection_scores']
    # Form detections
    detections = set()
    frame_height, frame_width, _ = frame.pixels.shape
    for box, class_, score in zip(boxes, classes, scores):
        metadata = {
            "raw_box": box,
            "class": self.category_index[class_],
            "score": score
        }
        # Transform box to be in format (x, y, w, h)
        state_vector = StateVector([box[1]*frame_width,
                                    box[0]*frame_height,
                                    (box[3] - box[1])*frame_width,
                                    (box[2] - box[0])*frame_height])
        detection = Detection(state_vector=state_vector,
                              timestamp=frame.timestamp,
                              metadata=metadata)
        detections.add(detection)
    return detections