def METHOD_NAME(self, model):
    # return_datasample
    img_path = 'tests/data/color.jpg'
    mock_load = Mock(return_value=None)
    with patch('mmengine.infer.infer._load_checkpoint', mock_load):
        inferencer = DetInferencer(model)
    # In the case of not loading the pretrained weight, the category
    # defaults to COCO 80, so it needs to be replaced.
    if model == 'panoptic_fpn_r50_fpn_1x_coco':
        inferencer.visualizer.dataset_meta = {
            'classes': get_classes('coco_panoptic'),
            'palette': 'random'
        }
    res = inferencer(img_path, return_datasample=True)
    self.assertTrue(is_list_of(res['predictions'], DetDataSample))
    with tempfile.TemporaryDirectory() as tmp_dir:
        res = inferencer(img_path, out_dir=tmp_dir, no_save_pred=False)
        dumped_res = mmengine.load(
            osp.join(tmp_dir, 'preds', 'color.json'))
        self.assertEqual(res['predictions'][0], dumped_res)