def convert_tf_to_pt(y: list[dict[str, np.ndarray]], height: int, width: int) -> list[dict[str, np.ndarray]]:
    """
    :param y: Target values of format `list[dict[Tensor]]`, one for each input image. The fields of the dict are as
              follows:

              - boxes (FloatTensor[N, 4]): the boxes in [y1, x1, y2, x2] format, with 0 <= x1 < x2 <= W and
                                           0 <= y1 < y2 <= H in scale [0, 1].
              - labels (Int64Tensor[N]): the labels for each image
              - scores (Tensor[N]): the scores or each prediction.
    :param height: Height of images in pixels.
    :param width: Width if images in pixels.

    :return: Target values of format `list[dict[Tensor]]`, one for each input image. The fields of the dict are as
             follows:

             - boxes (FloatTensor[N, 4]): the boxes in [x1, y1, x2, y2] format, with 0 <= x1 < x2 <= W and
                                          0 <= y1 < y2 <= H in image scale.
             - labels (Int64Tensor[N]): the labels for each image
             - scores (Tensor[N]): the scores or each prediction.
    """
    for i, _ in enumerate(y):
        y[i]["boxes"][:, 0] *= height
        y[i]["boxes"][:, 1] *= width
        y[i]["boxes"][:, 2] *= height
        y[i]["boxes"][:, 3] *= width

        y[i]["boxes"] = y[i]["boxes"][:, [1, 0, 3, 2]]

        y[i]["labels"] = y[i]["labels"] + 1

    return y

    :param y: Target values of format `list[dict[Tensor]]`, one for each input image. The fields of the dict are as
              follows:

              - boxes (FloatTensor[N, 4]): the boxes in [y1, x1, y2, x2] format, with 0 <= x1 < x2 <= W and
                                           0 <= y1 < y2 <= H in scale [0, 1].
              - labels (Int64Tensor[N]): the labels for each image
              - scores (Tensor[N]): the scores or each prediction.
    :param height: Height of images in pixels.
    :param width: Width if images in pixels.

    :return: Target values of format `list[dict[Tensor]]`, one for each input image. The fields of the dict are as
             follows:

             - boxes (FloatTensor[N, 4]): the boxes in [x1, y1, x2, y2] format, with 0 <= x1 < x2 <= W and
                                          0 <= y1 < y2 <= H in image scale.
             - labels (Int64Tensor[N]): the labels for each image
             - scores (Tensor[N]): the scores or each prediction.
    
art/estimators/object_detection/utils.py