forked from open-mmlab/mmdetection
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor anchor_generator and point_generator (open-mmlab#5349)
* add sparse priors * add mlvlpointsgenerator * revert __init__ of core * refactor reppoints * delete label channal * add docstr * fix typo * fix args * fix typo * fix doc * fix stride_h * add offset * add offset * fix docstr * new interface of single_proir * fix device * add unitest * add cuda unitest * add more cuda unintest * fix reppoints * fix device * add unintest for ssd and yolo and rename prior_idxs * add docstr for MlvlPointGenerator * add space * add num_base_priors
- Loading branch information
Showing
6 changed files
with
626 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
from .anchor_generator import (AnchorGenerator, LegacyAnchorGenerator, | ||
YOLOAnchorGenerator) | ||
from .builder import ANCHOR_GENERATORS, build_anchor_generator | ||
from .point_generator import PointGenerator | ||
from .builder import (ANCHOR_GENERATORS, PRIOR_GENERATORS, | ||
build_anchor_generator, build_prior_generator) | ||
from .point_generator import MlvlPointGenerator, PointGenerator | ||
from .utils import anchor_inside_flags, calc_region, images_to_levels | ||
|
||
__all__ = [ | ||
'AnchorGenerator', 'LegacyAnchorGenerator', 'anchor_inside_flags', | ||
'PointGenerator', 'images_to_levels', 'calc_region', | ||
'build_anchor_generator', 'ANCHOR_GENERATORS', 'YOLOAnchorGenerator' | ||
'build_anchor_generator', 'ANCHOR_GENERATORS', 'YOLOAnchorGenerator', | ||
'build_prior_generator', 'PRIOR_GENERATORS', 'MlvlPointGenerator' | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,18 @@ | ||
import warnings | ||
|
||
from mmcv.utils import Registry, build_from_cfg | ||
|
||
ANCHOR_GENERATORS = Registry('Anchor generator') | ||
PRIOR_GENERATORS = Registry('Generator for anchors and points') | ||
|
||
ANCHOR_GENERATORS = PRIOR_GENERATORS | ||
|
||
|
||
def build_prior_generator(cfg, default_args=None): | ||
return build_from_cfg(cfg, PRIOR_GENERATORS, default_args) | ||
|
||
|
||
def build_anchor_generator(cfg, default_args=None): | ||
return build_from_cfg(cfg, ANCHOR_GENERATORS, default_args) | ||
warnings.warn( | ||
'``build_anchor_generator`` would be deprecated soon, please use ' | ||
'``build_prior_generator`` ') | ||
return build_prior_generator(cfg, default_args=default_args) |
Oops, something went wrong.