From 9631844e89f8ec6641c1f363d56f6f03a63784ee Mon Sep 17 00:00:00 2001 From: SlideLucask <564521546@qq.com> Date: Fri, 31 May 2019 15:30:27 +0800 Subject: [PATCH] update GETTING_STARTED.md (#739) update init_detector() & inference_detector() parameter --- GETTING_STARTED.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GETTING_STARTED.md b/GETTING_STARTED.md index b5aac9d..b032801 100644 --- a/GETTING_STARTED.md +++ b/GETTING_STARTED.md @@ -68,7 +68,7 @@ config_file = 'configs/faster_rcnn_r50_fpn_1x.py' checkpoint_file = 'checkpoints/faster_rcnn_r50_fpn_1x_20181010-3d1b3351.pth' # build the model from a config file and a checkpoint file -model = init_detector(config_file, checkpoint_file) +model = init_detector(config_file, checkpoint_file, device='cuda:0')) # test a single image and show the results img = 'test.jpg' # or img = mmcv.imread(img), which will only load it once @@ -77,7 +77,7 @@ show_result(img, result, model.CLASSES) # test a list of images and write the results to image files imgs = ['test1.jpg', 'test2.jpg'] -for i, result in enumerate(inference_detector(model, imgs, device='cuda:0')): +for i, result in enumerate(inference_detector(model, imgs): show_result(imgs[i], result, model.CLASSES, out_file='result_{}.jpg'.format(i)) ``` -- GitLab