def _translate_labels(self, labels: list[dict[str, "torch.Tensor"]]) -> list[dict[str, "torch.Tensor"]]:
        """
        Translate object detection labels from ART format (torchvision) to the model format (DETR) and
        move tensors to GPU, if applicable.

        :param labels: Object detection labels in format x1y1x2y2 (torchvision).
        :return: Object detection labels in format xcycwh (DETR).
        """
        from art.estimators.object_detection.detr import revert_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]

        labels_translated: list[dict[str, "torch.Tensor"]] = []

        for label_dict in labels:
            label_dict_translated = {}

            boxes = revert_rescale_bboxes(label_dict["boxes"], (height, width))
            label_dict_translated["boxes"] = boxes.to(self.device)

            label = label_dict["labels"]
            label_dict_translated["labels"] = label.to(self.device)

            if "scores" in label_dict:
                scores = label_dict["scores"]
                label_dict_translated["scores"] = scores.to(self.device)

            labels_translated.append(label_dict_translated)

        return labels_translated

        Translate object detection labels from ART format (torchvision) to the model format (DETR) and
        move tensors to GPU, if applicable.

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