def _translate_predictions(self, predictions: dict[str, "torch.Tensor"]) -> list[dict[str, np.ndarray]]:
        """
        Translate object detection predictions from the model format (DETR) to ART format (torchvision) and
        convert tensors to numpy arrays.

        :param predictions: Object detection labels in format xcycwh (DETR).
        :return: Object detection labels in format x1y1x2y2 (torchvision).
        """
        from art.estimators.object_detection.detr import rescale_bboxes

        if self.channels_first:
            height = self.input_shape[1]
            width = self.input_shape[2]
        else:
            height = self.input_shape[0]
            width = self.input_shape[1]

        pred_boxes = predictions["pred_boxes"]
        pred_logits = predictions["pred_logits"]

        predictions_x1y1x2y2: list[dict[str, np.ndarray]] = []

        for pred_box, pred_logit in zip(pred_boxes, pred_logits):
            boxes = rescale_bboxes(pred_box.detach().cpu(), (height, width)).numpy()
            labels = pred_logit.unsqueeze(0).softmax(-1)[0, :, :-1].max(dim=1)[1].detach().cpu().numpy()
            scores = pred_logit.unsqueeze(0).softmax(-1)[0, :, :-1].max(dim=1)[0].detach().cpu().numpy()

            pred_dict = {
                "boxes": boxes,
                "labels": labels,
                "scores": scores,
            }

            predictions_x1y1x2y2.append(pred_dict)

        return predictions_x1y1x2y2

        Translate object detection predictions from the model format (DETR) to ART format (torchvision) and
        convert tensors to numpy arrays.

        :param predictions: Object detection labels in format xcycwh (DETR).
        :return: Object detection labels in format x1y1x2y2 (torchvision).
        
art/estimators/object_detection/pytorch_detection_transformer.py