We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
VFNET device error when run inference_detector
Hi everyone,

When a run the inference_detector to VFNET algorithm, I got this error message (only for VFNET, for ATSS ... no problems):

/usr/local/lib/python3.6/dist-packages/mmcv/parallel/_functions.py in forward(target_gpus, input)
     71             # Perform CPU to GPU copies in a background stream
     72             streams = [_get_stream(device) for device in target_gpus]
---> 73 
     74         outputs = scatter(input, target_gpus, streams)
     75         # Synchronize with the copy stream

/usr/local/lib/python3.6/dist-packages/torch/nn/parallel/_functions.py in _get_stream(device)
    117     if _streams is None:
    118         _streams = [None] * torch.cuda.device_count()
--> 119     if _streams[device] is None:
    120         _streams[device] = torch.cuda.Stream(device)
    121     return _streams[device]

TypeError: list indices must be integers or slices, not torch.device

The device paramenter of init_detector is default ('cuda:0') and distributed=False. Can you help me?


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `mmdet/apis/inference.py`
Content:
```
1 import warnings
2 
3 import matplotlib.pyplot as plt
4 import mmcv
5 import numpy as np
6 import torch
7 from mmcv.ops import RoIPool
8 from mmcv.parallel import collate, scatter
9 from mmcv.runner import load_checkpoint
10 
11 from mmdet.core import get_classes
12 from mmdet.datasets.pipelines import Compose
13 from mmdet.models import build_detector
14 
15 
16 def init_detector(config, checkpoint=None, device='cuda:0', cfg_options=None):
17     """Initialize a detector from config file.
18 
19     Args:
20         config (str or :obj:`mmcv.Config`): Config file path or the config
21             object.
22         checkpoint (str, optional): Checkpoint path. If left as None, the model
23             will not load any weights.
24         cfg_options (dict): Options to override some settings in the used
25             config.
26 
27     Returns:
28         nn.Module: The constructed detector.
29     """
30     if isinstance(config, str):
31         config = mmcv.Config.fromfile(config)
32     elif not isinstance(config, mmcv.Config):
33         raise TypeError('config must be a filename or Config object, '
34                         f'but got {type(config)}')
35     if cfg_options is not None:
36         config.merge_from_dict(cfg_options)
37     config.model.pretrained = None
38     model = build_detector(config.model, test_cfg=config.test_cfg)
39     if checkpoint is not None:
40         map_loc = 'cpu' if device == 'cpu' else None
41         checkpoint = load_checkpoint(model, checkpoint, map_location=map_loc)
42         if 'CLASSES' in checkpoint['meta']:
43             model.CLASSES = checkpoint['meta']['CLASSES']
44         else:
45             warnings.simplefilter('once')
46             warnings.warn('Class names are not saved in the checkpoint\'s '
47                           'meta data, use COCO classes by default.')
48             model.CLASSES = get_classes('coco')
49     model.cfg = config  # save the config in the model for convenience
50     model.to(device)
51     model.eval()
52     return model
53 
54 
55 class LoadImage(object):
56     """A simple pipeline to load image."""
57 
58     def __call__(self, results):
59         """Call function to load images into results.
60 
61         Args:
62             results (dict): A result dict contains the file name
63                 of the image to be read.
64 
65         Returns:
66             dict: ``results`` will be returned containing loaded image.
67         """
68         if isinstance(results['img'], str):
69             results['filename'] = results['img']
70             results['ori_filename'] = results['img']
71         else:
72             results['filename'] = None
73             results['ori_filename'] = None
74         img = mmcv.imread(results['img'])
75         results['img'] = img
76         results['img_fields'] = ['img']
77         results['img_shape'] = img.shape
78         results['ori_shape'] = img.shape
79         return results
80 
81 
82 def inference_detector(model, img):
83     """Inference image(s) with the detector.
84 
85     Args:
86         model (nn.Module): The loaded detector.
87         imgs (str/ndarray or list[str/ndarray]): Either image files or loaded
88             images.
89 
90     Returns:
91         If imgs is a str, a generator will be returned, otherwise return the
92         detection results directly.
93     """
94     cfg = model.cfg
95     device = next(model.parameters()).device  # model device
96     # prepare data
97     if isinstance(img, np.ndarray):
98         # directly add img
99         data = dict(img=img)
100         cfg = cfg.copy()
101         # set loading pipeline type
102         cfg.data.test.pipeline[0].type = 'LoadImageFromWebcam'
103     else:
104         # add information into dict
105         data = dict(img_info=dict(filename=img), img_prefix=None)
106     # build the data pipeline
107     test_pipeline = Compose(cfg.data.test.pipeline)
108     data = test_pipeline(data)
109     data = collate([data], samples_per_gpu=1)
110     if next(model.parameters()).is_cuda:
111         # scatter to specified GPU
112         data = scatter(data, [device])[0]
113     else:
114         for m in model.modules():
115             assert not isinstance(
116                 m, RoIPool
117             ), 'CPU inference with RoIPool is not supported currently.'
118         # just get the actual data from DataContainer
119         data['img_metas'] = data['img_metas'][0].data
120 
121     # forward the model
122     with torch.no_grad():
123         result = model(return_loss=False, rescale=True, **data)[0]
124     return result
125 
126 
127 async def async_inference_detector(model, img):
128     """Async inference image(s) with the detector.
129 
130     Args:
131         model (nn.Module): The loaded detector.
132         img (str | ndarray): Either image files or loaded images.
133 
134     Returns:
135         Awaitable detection results.
136     """
137     cfg = model.cfg
138     device = next(model.parameters()).device  # model device
139     # prepare data
140     if isinstance(img, np.ndarray):
141         # directly add img
142         data = dict(img=img)
143         cfg = cfg.copy()
144         # set loading pipeline type
145         cfg.data.test.pipeline[0].type = 'LoadImageFromWebcam'
146     else:
147         # add information into dict
148         data = dict(img_info=dict(filename=img), img_prefix=None)
149     # build the data pipeline
150     test_pipeline = Compose(cfg.data.test.pipeline)
151     data = test_pipeline(data)
152     data = scatter(collate([data], samples_per_gpu=1), [device])[0]
153 
154     # We don't restore `torch.is_grad_enabled()` value during concurrent
155     # inference since execution can overlap
156     torch.set_grad_enabled(False)
157     result = await model.aforward_test(rescale=True, **data)
158     return result
159 
160 
161 def show_result_pyplot(model,
162                        img,
163                        result,
164                        score_thr=0.3,
165                        fig_size=(15, 10),
166                        title='result',
167                        block=True):
168     """Visualize the detection results on the image.
169 
170     Args:
171         model (nn.Module): The loaded detector.
172         img (str or np.ndarray): Image filename or loaded image.
173         result (tuple[list] or list): The detection result, can be either
174             (bbox, segm) or just bbox.
175         score_thr (float): The threshold to visualize the bboxes and masks.
176         fig_size (tuple): Figure size of the pyplot figure.
177         title (str): Title of the pyplot figure.
178         block (bool): Whether to block GUI.
179     """
180     if hasattr(model, 'module'):
181         model = model.module
182     img = model.show_result(img, result, score_thr=score_thr, show=False)
183     plt.figure(figsize=fig_size)
184     plt.imshow(mmcv.bgr2rgb(img))
185     plt.title(title)
186     plt.tight_layout()
187     plt.show(block=block)
188
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/mmdet/apis/inference.py b/mmdet/apis/inference.py
--- a/mmdet/apis/inference.py
+++ b/mmdet/apis/inference.py
@@ -9,6 +9,7 @@
 from mmcv.runner import load_checkpoint
 
 from mmdet.core import get_classes
+from mmdet.datasets import replace_ImageToTensor
 from mmdet.datasets.pipelines import Compose
 from mmdet.models import build_detector
 
@@ -104,9 +105,13 @@
         # add information into dict
         data = dict(img_info=dict(filename=img), img_prefix=None)
     # build the data pipeline
+    cfg.data.test.pipeline = replace_ImageToTensor(cfg.data.test.pipeline)
     test_pipeline = Compose(cfg.data.test.pipeline)
     data = test_pipeline(data)
     data = collate([data], samples_per_gpu=1)
+    # just get the actual data from DataContainer
+    data['img_metas'] = [img_metas.data[0] for img_metas in data['img_metas']]
+    data['img'] = [img.data[0] for img in data['img']]
     if next(model.parameters()).is_cuda:
         # scatter to specified GPU
         data = scatter(data, [device])[0]
@@ -115,8 +120,6 @@
             assert not isinstance(
                 m, RoIPool
             ), 'CPU inference with RoIPool is not supported currently.'
-        # just get the actual data from DataContainer
-        data['img_metas'] = data['img_metas'][0].data
 
     # forward the model
     with torch.no_grad():

{"golden_diff": "diff --git a/mmdet/apis/inference.py b/mmdet/apis/inference.py\n--- a/mmdet/apis/inference.py\n+++ b/mmdet/apis/inference.py\n@@ -9,6 +9,7 @@\n from mmcv.runner import load_checkpoint\n \n from mmdet.core import get_classes\n+from mmdet.datasets import replace_ImageToTensor\n from mmdet.datasets.pipelines import Compose\n from mmdet.models import build_detector\n \n@@ -104,9 +105,13 @@\n         # add information into dict\n         data = dict(img_info=dict(filename=img), img_prefix=None)\n     # build the data pipeline\n+    cfg.data.test.pipeline = replace_ImageToTensor(cfg.data.test.pipeline)\n     test_pipeline = Compose(cfg.data.test.pipeline)\n     data = test_pipeline(data)\n     data = collate([data], samples_per_gpu=1)\n+    # just get the actual data from DataContainer\n+    data['img_metas'] = [img_metas.data[0] for img_metas in data['img_metas']]\n+    data['img'] = [img.data[0] for img in data['img']]\n     if next(model.parameters()).is_cuda:\n         # scatter to specified GPU\n         data = scatter(data, [device])[0]\n@@ -115,8 +120,6 @@\n             assert not isinstance(\n                 m, RoIPool\n             ), 'CPU inference with RoIPool is not supported currently.'\n-        # just get the actual data from DataContainer\n-        data['img_metas'] = data['img_metas'][0].data\n \n     # forward the model\n     with torch.no_grad():\n", "issue": "VFNET device error when run inference_detector\nHi everyone,\r\n\r\nWhen a run the inference_detector to VFNET algorithm, I got this error message (only for VFNET, for ATSS ... no problems):\r\n\r\n/usr/local/lib/python3.6/dist-packages/mmcv/parallel/_functions.py in forward(target_gpus, input)\r\n     71             # Perform CPU to GPU copies in a background stream\r\n     72             streams = [_get_stream(device) for device in target_gpus]\r\n---> 73 \r\n     74         outputs = scatter(input, target_gpus, streams)\r\n     75         # Synchronize with the copy stream\r\n\r\n/usr/local/lib/python3.6/dist-packages/torch/nn/parallel/_functions.py in _get_stream(device)\r\n    117     if _streams is None:\r\n    118         _streams = [None] * torch.cuda.device_count()\r\n--> 119     if _streams[device] is None:\r\n    120         _streams[device] = torch.cuda.Stream(device)\r\n    121     return _streams[device]\r\n\r\nTypeError: list indices must be integers or slices, not torch.device\r\n\r\nThe device paramenter of init_detector is default ('cuda:0') and distributed=False. Can you help me?\r\n\n", "before_files": [{"content": "import warnings\n\nimport matplotlib.pyplot as plt\nimport mmcv\nimport numpy as np\nimport torch\nfrom mmcv.ops import RoIPool\nfrom mmcv.parallel import collate, scatter\nfrom mmcv.runner import load_checkpoint\n\nfrom mmdet.core import get_classes\nfrom mmdet.datasets.pipelines import Compose\nfrom mmdet.models import build_detector\n\n\ndef init_detector(config, checkpoint=None, device='cuda:0', cfg_options=None):\n    \"\"\"Initialize a detector from config file.\n\n    Args:\n        config (str or :obj:`mmcv.Config`): Config file path or the config\n            object.\n        checkpoint (str, optional): Checkpoint path. If left as None, the model\n            will not load any weights.\n        cfg_options (dict): Options to override some settings in the used\n            config.\n\n    Returns:\n        nn.Module: The constructed detector.\n    \"\"\"\n    if isinstance(config, str):\n        config = mmcv.Config.fromfile(config)\n    elif not isinstance(config, mmcv.Config):\n        raise TypeError('config must be a filename or Config object, '\n                        f'but got {type(config)}')\n    if cfg_options is not None:\n        config.merge_from_dict(cfg_options)\n    config.model.pretrained = None\n    model = build_detector(config.model, test_cfg=config.test_cfg)\n    if checkpoint is not None:\n        map_loc = 'cpu' if device == 'cpu' else None\n        checkpoint = load_checkpoint(model, checkpoint, map_location=map_loc)\n        if 'CLASSES' in checkpoint['meta']:\n            model.CLASSES = checkpoint['meta']['CLASSES']\n        else:\n            warnings.simplefilter('once')\n            warnings.warn('Class names are not saved in the checkpoint\\'s '\n                          'meta data, use COCO classes by default.')\n            model.CLASSES = get_classes('coco')\n    model.cfg = config  # save the config in the model for convenience\n    model.to(device)\n    model.eval()\n    return model\n\n\nclass LoadImage(object):\n    \"\"\"A simple pipeline to load image.\"\"\"\n\n    def __call__(self, results):\n        \"\"\"Call function to load images into results.\n\n        Args:\n            results (dict): A result dict contains the file name\n                of the image to be read.\n\n        Returns:\n            dict: ``results`` will be returned containing loaded image.\n        \"\"\"\n        if isinstance(results['img'], str):\n            results['filename'] = results['img']\n            results['ori_filename'] = results['img']\n        else:\n            results['filename'] = None\n            results['ori_filename'] = None\n        img = mmcv.imread(results['img'])\n        results['img'] = img\n        results['img_fields'] = ['img']\n        results['img_shape'] = img.shape\n        results['ori_shape'] = img.shape\n        return results\n\n\ndef inference_detector(model, img):\n    \"\"\"Inference image(s) with the detector.\n\n    Args:\n        model (nn.Module): The loaded detector.\n        imgs (str/ndarray or list[str/ndarray]): Either image files or loaded\n            images.\n\n    Returns:\n        If imgs is a str, a generator will be returned, otherwise return the\n        detection results directly.\n    \"\"\"\n    cfg = model.cfg\n    device = next(model.parameters()).device  # model device\n    # prepare data\n    if isinstance(img, np.ndarray):\n        # directly add img\n        data = dict(img=img)\n        cfg = cfg.copy()\n        # set loading pipeline type\n        cfg.data.test.pipeline[0].type = 'LoadImageFromWebcam'\n    else:\n        # add information into dict\n        data = dict(img_info=dict(filename=img), img_prefix=None)\n    # build the data pipeline\n    test_pipeline = Compose(cfg.data.test.pipeline)\n    data = test_pipeline(data)\n    data = collate([data], samples_per_gpu=1)\n    if next(model.parameters()).is_cuda:\n        # scatter to specified GPU\n        data = scatter(data, [device])[0]\n    else:\n        for m in model.modules():\n            assert not isinstance(\n                m, RoIPool\n            ), 'CPU inference with RoIPool is not supported currently.'\n        # just get the actual data from DataContainer\n        data['img_metas'] = data['img_metas'][0].data\n\n    # forward the model\n    with torch.no_grad():\n        result = model(return_loss=False, rescale=True, **data)[0]\n    return result\n\n\nasync def async_inference_detector(model, img):\n    \"\"\"Async inference image(s) with the detector.\n\n    Args:\n        model (nn.Module): The loaded detector.\n        img (str | ndarray): Either image files or loaded images.\n\n    Returns:\n        Awaitable detection results.\n    \"\"\"\n    cfg = model.cfg\n    device = next(model.parameters()).device  # model device\n    # prepare data\n    if isinstance(img, np.ndarray):\n        # directly add img\n        data = dict(img=img)\n        cfg = cfg.copy()\n        # set loading pipeline type\n        cfg.data.test.pipeline[0].type = 'LoadImageFromWebcam'\n    else:\n        # add information into dict\n        data = dict(img_info=dict(filename=img), img_prefix=None)\n    # build the data pipeline\n    test_pipeline = Compose(cfg.data.test.pipeline)\n    data = test_pipeline(data)\n    data = scatter(collate([data], samples_per_gpu=1), [device])[0]\n\n    # We don't restore `torch.is_grad_enabled()` value during concurrent\n    # inference since execution can overlap\n    torch.set_grad_enabled(False)\n    result = await model.aforward_test(rescale=True, **data)\n    return result\n\n\ndef show_result_pyplot(model,\n                       img,\n                       result,\n                       score_thr=0.3,\n                       fig_size=(15, 10),\n                       title='result',\n                       block=True):\n    \"\"\"Visualize the detection results on the image.\n\n    Args:\n        model (nn.Module): The loaded detector.\n        img (str or np.ndarray): Image filename or loaded image.\n        result (tuple[list] or list): The detection result, can be either\n            (bbox, segm) or just bbox.\n        score_thr (float): The threshold to visualize the bboxes and masks.\n        fig_size (tuple): Figure size of the pyplot figure.\n        title (str): Title of the pyplot figure.\n        block (bool): Whether to block GUI.\n    \"\"\"\n    if hasattr(model, 'module'):\n        model = model.module\n    img = model.show_result(img, result, score_thr=score_thr, show=False)\n    plt.figure(figsize=fig_size)\n    plt.imshow(mmcv.bgr2rgb(img))\n    plt.title(title)\n    plt.tight_layout()\n    plt.show(block=block)\n", "path": "mmdet/apis/inference.py"}], "after_files": [{"content": "import warnings\n\nimport matplotlib.pyplot as plt\nimport mmcv\nimport numpy as np\nimport torch\nfrom mmcv.ops import RoIPool\nfrom mmcv.parallel import collate, scatter\nfrom mmcv.runner import load_checkpoint\n\nfrom mmdet.core import get_classes\nfrom mmdet.datasets import replace_ImageToTensor\nfrom mmdet.datasets.pipelines import Compose\nfrom mmdet.models import build_detector\n\n\ndef init_detector(config, checkpoint=None, device='cuda:0', cfg_options=None):\n    \"\"\"Initialize a detector from config file.\n\n    Args:\n        config (str or :obj:`mmcv.Config`): Config file path or the config\n            object.\n        checkpoint (str, optional): Checkpoint path. If left as None, the model\n            will not load any weights.\n        cfg_options (dict): Options to override some settings in the used\n            config.\n\n    Returns:\n        nn.Module: The constructed detector.\n    \"\"\"\n    if isinstance(config, str):\n        config = mmcv.Config.fromfile(config)\n    elif not isinstance(config, mmcv.Config):\n        raise TypeError('config must be a filename or Config object, '\n                        f'but got {type(config)}')\n    if cfg_options is not None:\n        config.merge_from_dict(cfg_options)\n    config.model.pretrained = None\n    model = build_detector(config.model, test_cfg=config.test_cfg)\n    if checkpoint is not None:\n        map_loc = 'cpu' if device == 'cpu' else None\n        checkpoint = load_checkpoint(model, checkpoint, map_location=map_loc)\n        if 'CLASSES' in checkpoint['meta']:\n            model.CLASSES = checkpoint['meta']['CLASSES']\n        else:\n            warnings.simplefilter('once')\n            warnings.warn('Class names are not saved in the checkpoint\\'s '\n                          'meta data, use COCO classes by default.')\n            model.CLASSES = get_classes('coco')\n    model.cfg = config  # save the config in the model for convenience\n    model.to(device)\n    model.eval()\n    return model\n\n\nclass LoadImage(object):\n    \"\"\"A simple pipeline to load image.\"\"\"\n\n    def __call__(self, results):\n        \"\"\"Call function to load images into results.\n\n        Args:\n            results (dict): A result dict contains the file name\n                of the image to be read.\n\n        Returns:\n            dict: ``results`` will be returned containing loaded image.\n        \"\"\"\n        if isinstance(results['img'], str):\n            results['filename'] = results['img']\n            results['ori_filename'] = results['img']\n        else:\n            results['filename'] = None\n            results['ori_filename'] = None\n        img = mmcv.imread(results['img'])\n        results['img'] = img\n        results['img_fields'] = ['img']\n        results['img_shape'] = img.shape\n        results['ori_shape'] = img.shape\n        return results\n\n\ndef inference_detector(model, img):\n    \"\"\"Inference image(s) with the detector.\n\n    Args:\n        model (nn.Module): The loaded detector.\n        imgs (str/ndarray or list[str/ndarray]): Either image files or loaded\n            images.\n\n    Returns:\n        If imgs is a str, a generator will be returned, otherwise return the\n        detection results directly.\n    \"\"\"\n    cfg = model.cfg\n    device = next(model.parameters()).device  # model device\n    # prepare data\n    if isinstance(img, np.ndarray):\n        # directly add img\n        data = dict(img=img)\n        cfg = cfg.copy()\n        # set loading pipeline type\n        cfg.data.test.pipeline[0].type = 'LoadImageFromWebcam'\n    else:\n        # add information into dict\n        data = dict(img_info=dict(filename=img), img_prefix=None)\n    # build the data pipeline\n    cfg.data.test.pipeline = replace_ImageToTensor(cfg.data.test.pipeline)\n    test_pipeline = Compose(cfg.data.test.pipeline)\n    data = test_pipeline(data)\n    data = collate([data], samples_per_gpu=1)\n    # just get the actual data from DataContainer\n    data['img_metas'] = [img_metas.data[0] for img_metas in data['img_metas']]\n    data['img'] = [img.data[0] for img in data['img']]\n    if next(model.parameters()).is_cuda:\n        # scatter to specified GPU\n        data = scatter(data, [device])[0]\n    else:\n        for m in model.modules():\n            assert not isinstance(\n                m, RoIPool\n            ), 'CPU inference with RoIPool is not supported currently.'\n\n    # forward the model\n    with torch.no_grad():\n        result = model(return_loss=False, rescale=True, **data)[0]\n    return result\n\n\nasync def async_inference_detector(model, img):\n    \"\"\"Async inference image(s) with the detector.\n\n    Args:\n        model (nn.Module): The loaded detector.\n        img (str | ndarray): Either image files or loaded images.\n\n    Returns:\n        Awaitable detection results.\n    \"\"\"\n    cfg = model.cfg\n    device = next(model.parameters()).device  # model device\n    # prepare data\n    if isinstance(img, np.ndarray):\n        # directly add img\n        data = dict(img=img)\n        cfg = cfg.copy()\n        # set loading pipeline type\n        cfg.data.test.pipeline[0].type = 'LoadImageFromWebcam'\n    else:\n        # add information into dict\n        data = dict(img_info=dict(filename=img), img_prefix=None)\n    # build the data pipeline\n    test_pipeline = Compose(cfg.data.test.pipeline)\n    data = test_pipeline(data)\n    data = scatter(collate([data], samples_per_gpu=1), [device])[0]\n\n    # We don't restore `torch.is_grad_enabled()` value during concurrent\n    # inference since execution can overlap\n    torch.set_grad_enabled(False)\n    result = await model.aforward_test(rescale=True, **data)\n    return result\n\n\ndef show_result_pyplot(model,\n                       img,\n                       result,\n                       score_thr=0.3,\n                       fig_size=(15, 10),\n                       title='result',\n                       block=True):\n    \"\"\"Visualize the detection results on the image.\n\n    Args:\n        model (nn.Module): The loaded detector.\n        img (str or np.ndarray): Image filename or loaded image.\n        result (tuple[list] or list): The detection result, can be either\n            (bbox, segm) or just bbox.\n        score_thr (float): The threshold to visualize the bboxes and masks.\n        fig_size (tuple): Figure size of the pyplot figure.\n        title (str): Title of the pyplot figure.\n        block (bool): Whether to block GUI.\n    \"\"\"\n    if hasattr(model, 'module'):\n        model = model.module\n    img = model.show_result(img, result, score_thr=score_thr, show=False)\n    plt.figure(figsize=fig_size)\n    plt.imshow(mmcv.bgr2rgb(img))\n    plt.title(title)\n    plt.tight_layout()\n    plt.show(block=block)\n", "path": "mmdet/apis/inference.py"}]}