Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
SOLOv2-pytorch
Commits
9631844e
Commit
9631844e
authored
May 31, 2019
by
SlideLucask
Committed by
Kai Chen
May 31, 2019
Browse files
update GETTING_STARTED.md (#739)
update init_detector() & inference_detector() parameter
parent
d22575cc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
GETTING_STARTED.md
GETTING_STARTED.md
+2
-2
No files found.
GETTING_STARTED.md
View file @
9631844e
...
@@ -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
))
```
```
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment