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
d2cde908
Commit
d2cde908
authored
Dec 11, 2018
by
yhcao6
Browse files
change the interface of build_sampler and build_assigner, replace default_args with **kwargs
parent
6a363603
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
mmdet/core/bbox/assign_sampling.py
mmdet/core/bbox/assign_sampling.py
+4
-4
No files found.
mmdet/core/bbox/assign_sampling.py
View file @
d2cde908
...
@@ -3,23 +3,23 @@ import mmcv
...
@@ -3,23 +3,23 @@ import mmcv
from
.
import
assigners
,
samplers
from
.
import
assigners
,
samplers
def
build_assigner
(
cfg
,
default_args
=
None
):
def
build_assigner
(
cfg
,
**
kwargs
):
if
isinstance
(
cfg
,
assigners
.
BaseAssigner
):
if
isinstance
(
cfg
,
assigners
.
BaseAssigner
):
return
cfg
return
cfg
elif
isinstance
(
cfg
,
dict
):
elif
isinstance
(
cfg
,
dict
):
return
mmcv
.
runner
.
obj_from_dict
(
return
mmcv
.
runner
.
obj_from_dict
(
cfg
,
assigners
,
default_args
=
default_
args
)
cfg
,
assigners
,
default_args
=
kw
args
)
else
:
else
:
raise
TypeError
(
'Invalid type {} for building a sampler'
.
format
(
raise
TypeError
(
'Invalid type {} for building a sampler'
.
format
(
type
(
cfg
)))
type
(
cfg
)))
def
build_sampler
(
cfg
,
default_args
=
None
):
def
build_sampler
(
cfg
,
**
kwargs
):
if
isinstance
(
cfg
,
samplers
.
BaseSampler
):
if
isinstance
(
cfg
,
samplers
.
BaseSampler
):
return
cfg
return
cfg
elif
isinstance
(
cfg
,
dict
):
elif
isinstance
(
cfg
,
dict
):
return
mmcv
.
runner
.
obj_from_dict
(
return
mmcv
.
runner
.
obj_from_dict
(
cfg
,
samplers
,
default_args
=
default_
args
)
cfg
,
samplers
,
default_args
=
kw
args
)
else
:
else
:
raise
TypeError
(
'Invalid type {} for building a sampler'
.
format
(
raise
TypeError
(
'Invalid type {} for building a sampler'
.
format
(
type
(
cfg
)))
type
(
cfg
)))
...
...
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