From dc4728cf3bef4a6cf816b9958b9dc5306682217f Mon Sep 17 00:00:00 2001 From: kazet Date: Mon, 11 Jan 2021 16:45:25 +0100 Subject: [PATCH] Corrected the get_started.md example inference It did not contain the checkpoint download step. --- docs/get_started.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/get_started.md b/docs/get_started.md index 19a1ad8dcf3..e2b8aa76778 100644 --- a/docs/get_started.md +++ b/docs/get_started.md @@ -188,15 +188,18 @@ PYTHONPATH="$(dirname $0)/..":$PYTHONPATH ## Verification -To verify whether MMDetection and the required environment are installed correctly, we can run sample python codes to initialize a detector and inference a demo image: +To verify whether MMDetection and the required environment are installed correctly, we can run sample Python code to initialize a detector and run inference a demo image: ```python from mmdet.apis import init_detector, inference_detector config_file = 'configs/faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py' +# download the checkpoint from model zoo and put it in `checkpoints/` +# url: http://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_r50_fpn_1x_coco/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth +checkpoint_file = 'checkpoints/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth' device = 'cuda:0' # init a detector -model = init_detector(config_file, device=device) +model = init_detector(config_file, checkpoint_file, device=device) # inference the demo image inference_detector(model, 'demo/demo.jpg') ```