How to visualize mask and bboxes from object detection tutorial

I have been following this official guide TorchVision Object Detection Finetuning Tutorial — PyTorch Tutorials 2.2.0+cu121 documentation and would like to visualise bboxes and ground truth mask. How can I do that?

Target looks this way:
{‘boxes’: tensor([[849., 525., 959., 635.],
[581., 659., 737., 867.],
[890., 734., 959., 813.],
[632., 839., 855., 945.]]),
‘labels’: tensor([1, 1, 1, 1]),
‘masks’: tensor([[[0, 0, 0, …, 0, 0, 0],
[0, 0, 0, …, 0, 0, 0],
[0, 0, 0, …, 0, 0, 0],
…,
[0, 0, 0, …, 0, 0, 0],
[0, 0, 0, …, 0, 0, 0],
[0, 0, 0, …, 0, 0, 0]],

     [[0, 0, 0,  ..., 0, 0, 0],
      [0, 0, 0,  ..., 0, 0, 0],
      [0, 0, 0,  ..., 0, 0, 0],
      ...,
      [0, 0, 0,  ..., 0, 0, 0],
      [0, 0, 0,  ..., 0, 0, 0],
      [0, 0, 0,  ..., 0, 0, 0]],

     [[0, 0, 0,  ..., 0, 0, 0],
      [0, 0, 0,  ..., 0, 0, 0],
      [0, 0, 0,  ..., 0, 0, 0],
      ...,
      [0, 0, 0,  ..., 0, 0, 0],
      [0, 0, 0,  ..., 0, 0, 0],
      [0, 0, 0,  ..., 0, 0, 0]],

     [[0, 0, 0,  ..., 0, 0, 0],
      [0, 0, 0,  ..., 0, 0, 0],
      [0, 0, 0,  ..., 0, 0, 0],
      ...,
      [0, 0, 0,  ..., 0, 0, 0],
      [0, 0, 0,  ..., 0, 0, 0],
      [0, 0, 0,  ..., 0, 0, 0]]], dtype=torch.uint8),

‘image_id’: tensor([1]),
‘area’: tensor([12100., 32448., 5451., 23638.]),
‘iscrowd’: tensor([0, 0, 0, 0])}

I would like to get something like this: