code: def test_fixed_sized_crop_against_detection_reference():
      def make_tv_tensors():
          size = (600, 800)
          num_objects = 22
  
          pil_image = to_pil_image(
              make_image(size=size, color_space="RGB")
          )
          target = {
              "boxes": make_bounding_boxes(
                  canvas_size=size,
                  format="XYXY",
                  num_boxes=num_objects,
                  dtype=torch.float,
              ),
              "labels": make_label(
                  extra_dims=(num_objects,), categories=80
              ),
              "masks": make_detection_masks(
                  size=size, num_masks=num_objects, dtype=torch.long
              ),
          }
  
          yield (pil_image, target)
  
          tensor_image = torch.Tensor(
              make_image(size=size, color_space="RGB")
          )
          target = {
              "boxes": make_bounding_boxes(
                  canvas_size=size,
                  format="XYXY",
                  num_boxes=num_objects,
                  dtype=torch.float,
              ),
              "labels": make_label(
                  extra_dims=(num_objects,), categories=80
              ),
              "masks": make_detection_masks(
                  size=size, num_masks=num_objects, dtype=torch.long
              ),
          }
  
          yield (tensor_image, target)
  
          tv_tensor_image = make_image(size=size, color_space="RGB")
          target = {
              "boxes": make_bounding_boxes(
                  canvas_size=size,
                  format="XYXY",
                  num_boxes=num_objects,
                  dtype=torch.float,
              ),
              "labels": make_label(
                  extra_dims=(num_objects,), categories=80
              ),
              "masks": make_detection_masks(
                  size=size, num_masks=num_objects, dtype=torch.long
              ),
          }
  
          yield (tv_tensor_image, target)
  
      t = transforms.FixedSizeCrop((1024, 1024), fill=0)
      t_ref = det_transforms.FixedSizeCrop((1024, 1024), fill=0)
  
      for dp in make_tv_tensors():
          # We should use prototype transform first as reference transform performs inplace target update
          torch.manual_seed(12)
          output = t(dp)
  
          torch.manual_seed(12)
          expected_output = t_ref(*dp)
  
          assert_equal(expected_output, output)
  
imports: import collections.abc
  import re
  import PIL.Image
  import pytest
  import torch
  from common_utils import assert_equal, make_bounding_boxes, make_detection_masks, make_image, make_video
  from torchvision.prototype import transforms, tv_tensors
  from torchvision.transforms.v2._utils import check_type, is_pure_tensor
  from torchvision.transforms.v2.functional import clamp_bounding_boxes, InterpolationMode, pil_to_tensor, to_pil_image
  from torchvision.tv_tensors import BoundingBoxes, BoundingBoxFormat, Image, Mask, Video
  import importlib.machinery
  import importlib.util
  from pathlib import Path
label_desc: Use image node_id 4 for calling a global function with example usage: test_fixed_sized_crop_against_detection_reference() without return types