def METHOD_NAME(self, image, threshold):
    image = np.array(image)
    image = image[:, :, ::-1].copy()
    h, w, _ = image.shape
    detections = self._infer(image)
    results = []
    if detections:
        boxes = detections[0]
        labels = detections[1]
        scores = detections[2]
        for label, score, box in zip(labels, scores, boxes):
            if score >= threshold:
                xtl = max(int(box[0]), 0)
                ytl = max(int(box[1]), 0)
                xbr = min(int(box[2]), w)
                ybr = min(int(box[3]), h)
                results.append({
                    "confidence": str(score),
                    "label": self.labels.get(label, "unknown"),
                    "points": [xtl, ytl, xbr, ybr],
                    "type": "rectangle",
                })
    return results