Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
......@@ -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))
```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment