code: def test_heatmaps_to_keypoints(self):
      maps = torch.rand(10, 1, 26, 26)
      rois = torch.rand(10, 4)
      from torchvision.models.detection.roi_heads import (
          heatmaps_to_keypoints,
      )
  
      out = heatmaps_to_keypoints(maps, rois)
      jit_trace = torch.jit.trace(heatmaps_to_keypoints, (maps, rois))
      out_trace = jit_trace(maps, rois)
  
      assert_equal(out[0], out_trace[0])
      assert_equal(out[1], out_trace[1])
  
      maps2 = torch.rand(20, 2, 21, 21)
      rois2 = torch.rand(20, 4)
      from torchvision.models.detection.roi_heads import (
          heatmaps_to_keypoints,
      )
  
      out2 = heatmaps_to_keypoints(maps2, rois2)
      out_trace2 = jit_trace(maps2, rois2)
  
      assert_equal(out2[0], out_trace2[0])
      assert_equal(out2[1], out_trace2[1])
  
imports: import io
  from collections import OrderedDict
  from typing import List, Optional, Tuple
  import pytest
  import torch
  from common_utils import assert_equal, set_rng_seed
  from torchvision import models, ops
  from torchvision.models.detection.faster_rcnn import FastRCNNPredictor, TwoMLPHead
  from torchvision.models.detection.image_list import ImageList
  from torchvision.models.detection.roi_heads import RoIHeads
  from torchvision.models.detection.rpn import AnchorGenerator, RegionProposalNetwork, RPNHead
  from torchvision.models.detection.transform import GeneralizedRCNNTransform
  from torchvision.ops import _register_onnx_ops
label_desc: Use image node_id 25 for calling the TestONNXExporter obj's underlying member method code with example usage: obj.test_heatmaps_to_keypoints() without return types