Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
Swin-Transformer-Object-Detection
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wanggh
Swin-Transformer-Object-Detection
Commits
f2f744a6
Unverified
Commit
f2f744a6
authored
4 years ago
by
Jerry Jiarui XU
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fixed webcam demo (#2596)
* fixed webcam demo * fixed show=True * add warning when show=False and out_file=None
parent
d215aa25
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
demo/webcam_demo.py
+3
-3
3 additions, 3 deletions
demo/webcam_demo.py
mmdet/models/detectors/base.py
+3
-0
3 additions, 0 deletions
mmdet/models/detectors/base.py
with
6 additions
and
3 deletions
demo/webcam_demo.py
+
3
−
3
View file @
f2f744a6
...
...
@@ -3,7 +3,7 @@ import argparse
import
cv2
import
torch
from
mmdet.apis
import
inference_detector
,
init_detector
,
show_result
from
mmdet.apis
import
inference_detector
,
init_detector
def
parse_args
():
...
...
@@ -38,8 +38,8 @@ def main():
if
ch
==
27
or
ch
==
ord
(
'
q
'
)
or
ch
==
ord
(
'
Q
'
):
break
show_result
(
img
,
result
,
model
.
CLASSES
,
score_thr
=
args
.
score_thr
,
wait_time
=
1
)
model
.
show_result
(
img
,
result
,
score_thr
=
args
.
score_thr
,
wait_time
=
1
,
show
=
True
)
if
__name__
==
'
__main__
'
:
...
...
This diff is collapsed.
Click to expand it.
mmdet/models/detectors/base.py
+
3
−
0
View file @
f2f744a6
import
warnings
from
abc
import
ABCMeta
,
abstractmethod
import
mmcv
...
...
@@ -232,4 +233,6 @@ class BaseDetector(nn.Module, metaclass=ABCMeta):
out_file
=
out_file
)
if
not
(
show
or
out_file
):
warnings
.
warn
(
'
show==False and out_file is not specified, only
'
'
result image will be returned
'
)
return
img
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment