def METHOD_NAME(self):
    num_classes = 8
    bbox_head = SABLHead(reg_class_agnostic=True, num_classes=num_classes)
    s = 20
    img_metas = [{
        'img_shape': (s, s, 3),
        'scale_factor': 1,
    }]
    sampling_results = [SamplingResult.random()]
    num_samples = 20
    rois = torch.rand((num_samples, 4))
    roi_img_ids = torch.zeros(num_samples, 1)
    rois = torch.cat((roi_img_ids, rois), dim=1)
    cls_scores = torch.rand((num_samples, num_classes + 1))
    cls_preds = torch.rand((num_samples, 28))
    offset_preds = torch.rand((num_samples, 28))
    labels = torch.randint(0, num_classes + 1, (num_samples, )).long()
    bbox_targets = (labels, None, None, None)
    bbox_results = dict(
        rois=rois,
        bbox_pred=(cls_preds, offset_preds),
        cls_score=cls_scores,
        bbox_targets=bbox_targets)
    bbox_list = bbox_head.refine_bboxes(
        sampling_results=sampling_results,
        bbox_results=bbox_results,
        batch_img_metas=img_metas)
    self.assertGreaterEqual(num_samples, len(bbox_list[0]))
    self.assertIsInstance(bbox_list[0], InstanceData)
    self.assertEqual(bbox_list[0].bboxes.shape[1], 4)