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
46a0de62
Commit
46a0de62
authored
Dec 25, 2018
by
Kai Chen
Browse files
minor bug fix
parent
c5d8f002
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletion
+3
-1
mmdet/core/loss/losses.py
mmdet/core/loss/losses.py
+2
-0
tools/test.py
tools/test.py
+1
-1
No files found.
mmdet/core/loss/losses.py
View file @
46a0de62
...
@@ -92,6 +92,8 @@ def accuracy(pred, target, topk=1):
...
@@ -92,6 +92,8 @@ def accuracy(pred, target, topk=1):
if
isinstance
(
topk
,
int
):
if
isinstance
(
topk
,
int
):
topk
=
(
topk
,
)
topk
=
(
topk
,
)
return_single
=
True
return_single
=
True
else
:
return_single
=
False
maxk
=
max
(
topk
)
maxk
=
max
(
topk
)
_
,
pred_label
=
pred
.
topk
(
maxk
,
1
,
True
,
True
)
_
,
pred_label
=
pred
.
topk
(
maxk
,
1
,
True
,
True
)
...
...
tools/test.py
View file @
46a0de62
...
@@ -23,7 +23,7 @@ def single_test(model, data_loader, show=False):
...
@@ -23,7 +23,7 @@ def single_test(model, data_loader, show=False):
if
show
:
if
show
:
model
.
module
.
show_result
(
data
,
result
,
dataset
.
img_norm_cfg
,
model
.
module
.
show_result
(
data
,
result
,
dataset
.
img_norm_cfg
,
dataset
.
CLASSES
)
dataset
=
dataset
.
CLASSES
)
batch_size
=
data
[
'img'
][
0
].
size
(
0
)
batch_size
=
data
[
'img'
][
0
].
size
(
0
)
for
_
in
range
(
batch_size
):
for
_
in
range
(
batch_size
):
...
...
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