Commit 9631844e authored by SlideLucask's avatar SlideLucask Committed by Kai Chen
Browse files

update GETTING_STARTED.md (#739)

update init_detector() & inference_detector() parameter
parent d22575cc
...@@ -68,7 +68,7 @@ config_file = 'configs/faster_rcnn_r50_fpn_1x.py' ...@@ -68,7 +68,7 @@ config_file = 'configs/faster_rcnn_r50_fpn_1x.py'
checkpoint_file = 'checkpoints/faster_rcnn_r50_fpn_1x_20181010-3d1b3351.pth' checkpoint_file = 'checkpoints/faster_rcnn_r50_fpn_1x_20181010-3d1b3351.pth'
# build the model from a config file and a checkpoint file # 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 # test a single image and show the results
img = 'test.jpg' # or img = mmcv.imread(img), which will only load it once img = 'test.jpg' # or img = mmcv.imread(img), which will only load it once
...@@ -77,7 +77,7 @@ show_result(img, result, model.CLASSES) ...@@ -77,7 +77,7 @@ show_result(img, result, model.CLASSES)
# test a list of images and write the results to image files # test a list of images and write the results to image files
imgs = ['test1.jpg', 'test2.jpg'] 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)) show_result(imgs[i], result, model.CLASSES, out_file='result_{}.jpg'.format(i))
``` ```
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment