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
63b9d104
Commit
63b9d104
authored
Aug 09, 2019
by
simon wu
Committed by
Kai Chen
Aug 09, 2019
Browse files
Press key to exit (#1155)
parent
87d9ca49
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
tools/webcam_demo.py
tools/webcam_demo.py
+6
-0
No files found.
tools/webcam_demo.py
View file @
63b9d104
...
@@ -27,9 +27,15 @@ def main():
...
@@ -27,9 +27,15 @@ def main():
camera
=
cv2
.
VideoCapture
(
args
.
camera_id
)
camera
=
cv2
.
VideoCapture
(
args
.
camera_id
)
print
(
'Press "Esc", "q" or "Q" to exit.'
)
while
True
:
while
True
:
ret_val
,
img
=
camera
.
read
()
ret_val
,
img
=
camera
.
read
()
result
=
inference_detector
(
model
,
img
)
result
=
inference_detector
(
model
,
img
)
ch
=
cv2
.
waitKey
(
1
)
if
ch
==
27
or
ch
==
ord
(
'q'
)
or
ch
==
ord
(
'Q'
):
break
show_result
(
show_result
(
img
,
result
,
model
.
CLASSES
,
score_thr
=
args
.
score_thr
,
wait_time
=
1
)
img
,
result
,
model
.
CLASSES
,
score_thr
=
args
.
score_thr
,
wait_time
=
1
)
...
...
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