From c298a0a36609763ed1dc967e9ce8355883d5f05a Mon Sep 17 00:00:00 2001 From: Kai Chen Date: Tue, 26 May 2020 11:00:52 +0800 Subject: [PATCH] fix the jupyter notebook demo (#2814) --- demo/inference_demo.ipynb | 14 ++++++-------- mmdet/apis/inference.py | 1 + 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/demo/inference_demo.ipynb b/demo/inference_demo.ipynb index e94a8c592..565efd724 100644 --- a/demo/inference_demo.ipynb +++ b/demo/inference_demo.ipynb @@ -16,7 +16,7 @@ "metadata": {}, "outputs": [], "source": [ - "config_file = '../configs/faster_rcnn_r50_fpn_1x_coco.py'\n", + "config_file = '../configs/faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py'\n", "# download the checkpoint from model zoo and put it in `checkpoints/`\n", "checkpoint_file = '../checkpoints/faster_rcnn_r50_fpn_1x_20181010-3d1b3351.pth'" ] @@ -45,9 +45,7 @@ { "cell_type": "code", "execution_count": 5, - "metadata": { - "scrolled": false - }, + "metadata": {}, "outputs": [ { "data": { @@ -84,18 +82,18 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.3" + "version": "3.7.7" }, "pycharm": { "stem_cell": { "cell_type": "raw", - "source": [], "metadata": { "collapsed": false - } + }, + "source": [] } } }, "nbformat": 4, - "nbformat_minor": 2 + "nbformat_minor": 4 } diff --git a/mmdet/apis/inference.py b/mmdet/apis/inference.py index 9c4f6cc3f..9a42c5023 100644 --- a/mmdet/apis/inference.py +++ b/mmdet/apis/inference.py @@ -57,6 +57,7 @@ class LoadImage(object): results['ori_filename'] = None img = mmcv.imread(results['img']) results['img'] = img + results['img_fields'] = ['img'] results['img_shape'] = img.shape results['ori_shape'] = img.shape return results