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') ```