def METHOD_NAME(self):
    data = get_coco_sample(img_shape=(512, 512), num_instances=1)
    data = self._make_multi_instance_data(data)
    # w/o keypoint heatmaps
    codec = SPR(
        input_size=(512, 512),
        heatmap_size=(128, 128),
        sigma=4,
    )
    encoded = codec.encode(data['keypoints'], data['keypoints_visible'])
    heatmaps = encoded['heatmaps']
    displacements = encoded['displacements']
    heatmap_weights = encoded['heatmap_weights']
    displacement_weights = encoded['displacement_weights']
    self.assertEqual(heatmaps.shape, (1, 128, 128))
    self.assertEqual(heatmap_weights.shape, (1, 128, 128))
    self.assertEqual(displacements.shape, (34, 128, 128))
    self.assertEqual(displacement_weights.shape, (34, 128, 128))
    # w/ keypoint heatmaps
    with self.assertRaises(AssertionError):
        codec = SPR(
            input_size=(512, 512),
            heatmap_size=(128, 128),
            sigma=4,
            generate_keypoint_heatmaps=True,
        )
    codec = SPR(
        input_size=(512, 512),
        heatmap_size=(128, 128),
        sigma=(4, 2),
        generate_keypoint_heatmaps=True,
    )
    encoded = codec.encode(data['keypoints'], data['keypoints_visible'])
    heatmaps = encoded['heatmaps']
    displacements = encoded['displacements']
    heatmap_weights = encoded['heatmap_weights']
    displacement_weights = encoded['displacement_weights']
    self.assertEqual(heatmaps.shape, (18, 128, 128))
    self.assertEqual(heatmap_weights.shape, (18, 128, 128))
    self.assertEqual(displacements.shape, (34, 128, 128))
    self.assertEqual(displacement_weights.shape, (34, 128, 128))
    # root_type
    with self.assertRaises(ValueError):
        codec = SPR(
            input_size=(512, 512),
            heatmap_size=(128, 128),
            sigma=(4, ),
            root_type='box_center',
        )
        encoded = codec.encode(data['keypoints'],
                               data['keypoints_visible'])
    codec = SPR(
        input_size=(512, 512),
        heatmap_size=(128, 128),
        sigma=(4, ),
        root_type='bbox_center',
    )
    encoded = codec.encode(data['keypoints'], data['keypoints_visible'])
    heatmaps = encoded['heatmaps']
    displacements = encoded['displacements']
    heatmap_weights = encoded['heatmap_weights']
    displacement_weights = encoded['displacement_weights']
    self.assertEqual(heatmaps.shape, (1, 128, 128))
    self.assertEqual(heatmap_weights.shape, (1, 128, 128))
    self.assertEqual(displacements.shape, (34, 128, 128))
    self.assertEqual(displacement_weights.shape, (34, 128, 128))