Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[refactor] Training of densehead #6315

Merged
merged 31 commits into from
Oct 25, 2021

Conversation

jshilong
Copy link
Collaborator

@jshilong jshilong commented Oct 19, 2021

Motivation

Continue the refactoring of the dense head which hope to unified the anchor head and anchor_free_head

Modification

  • Migrating training code in dense heads to the new interface of prior_generator
  • Unifying some basic concepts in dense heads, such as num_base_priors which mean the number of anchors on each feature map points

BC-breaking (Optional)

None

  • anchor_free
  • anchor_head
  • atss
  • autoassign
  • base_dense_head
  • base_mask_head
  • cascade_rpn_head
  • centernet_head
  • centripetal_head
  • deform_detr
  • detr
  • embedding_rpn
  • fcos
  • fovea
  • free_anchor
  • fsaf
  • ga_retina
  • ga_rpn
  • gfl
  • guided_anchor_head
  • ld_head
  • nas_fcos
  • paa_head
  • pisa_retina
  • pisa_ssd
  • reppoints
  • retina
  • retina_sep_bn
  • rpn_head
  • sabl_retina
  • solo
  • ssd
  • vfnet
  • yolact
  • yolo
  • yolof
  • yolox

hhaAndroid and others added 14 commits August 11, 2021 16:17
* revert batch to single

* update anchor_head

* replace preds with bboxes

* add point_bbox_coder

* FCOS add get_selected_priori

* unified anchor-free and anchor-based get_bbox_single

* update code

* update reppoints and sabl

* 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

* Unified bbox coder

* add offset

* remove point_bbox_coder.py

* fix docstr

* new interface of single_proir

* fix device

* add unitest

* add cuda unitest

* add more cuda unintest

* fix reppoints

* fix device

* update all prior

* update vfnet

* add unintest for ssd and yolo and rename prior_idxs

* add docstr for MlvlPointGenerator

* update reppoints and rpnhead

* add space

* add num_base_priors

* update some model

* update docstr

* fixAugFPN test and lint.

* Fix autoassign

* add docs

* Unified fcos decoding

* update docstr

* fix train error

* Fix Vfnet

* Fix some

* update centernet

* revert

* add warnings

* fix unittest error

* delete duplicated

* fix comment

* fix docs

* fix type

Co-authored-by: zhangshilong <2392587229zsl@gmail.com>
@jshilong jshilong changed the base branch from master to refactor_dense October 19, 2021 07:45
@jshilong jshilong changed the title Refactor one stage train [refactor] Training of densehead Oct 19, 2021
@jshilong jshilong requested review from hhaAndroid, BIGWangYuDong, RangiLyu, AronLin and ZwwWayne and removed request for hhaAndroid October 19, 2021 13:41
Copy link
Collaborator

@hhaAndroid hhaAndroid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@jshilong
Copy link
Collaborator Author

ALL unitests have been fixed in #6330

mmdet/core/anchor/point_generator.py Show resolved Hide resolved
mmdet/models/dense_heads/fcos_head.py Outdated Show resolved Hide resolved
mmdet/models/dense_heads/fcos_head.py Outdated Show resolved Hide resolved

# in order to unify the get_bbox logic. Not needed during training.
self.test_prior_generator = MlvlPointGenerator(
self.fcos_prior_generator = MlvlPointGenerator(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should also use build_prior_generator?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not support build prior_generator for all anchor free head mainly for two reasons

  • There is only one type of point generator for the time being
  • We have to deprecate strides in anchor_free_head, which is very complicated if we want to avoid bc-breaking

mmdet/models/dense_heads/vfnet_head.py Show resolved Hide resolved
Copy link
Member

@RangiLyu RangiLyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except for some docstring, LGTM.

mmdet/models/dense_heads/anchor_head.py Outdated Show resolved Hide resolved
mmdet/models/dense_heads/base_dense_head.py Outdated Show resolved Hide resolved
@ZwwWayne ZwwWayne merged commit 5c5426b into open-mmlab:refactor_dense Oct 25, 2021
jshilong added a commit that referenced this pull request Oct 25, 2021
* Refactor one-stage get_bboxes logic (#5317)

* revert batch to single

* update anchor_head

* replace preds with bboxes

* add point_bbox_coder

* FCOS add get_selected_priori

* unified anchor-free and anchor-based get_bbox_single

* update code

* update reppoints and sabl

* 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

* Unified bbox coder

* add offset

* remove point_bbox_coder.py

* fix docstr

* new interface of single_proir

* fix device

* add unitest

* add cuda unitest

* add more cuda unintest

* fix reppoints

* fix device

* update all prior

* update vfnet

* add unintest for ssd and yolo and rename prior_idxs

* add docstr for MlvlPointGenerator

* update reppoints and rpnhead

* add space

* add num_base_priors

* update some model

* update docstr

* fixAugFPN test and lint.

* Fix autoassign

* add docs

* Unified fcos decoding

* update docstr

* fix train error

* Fix Vfnet

* Fix some

* update centernet

* revert

* add warnings

* fix unittest error

* delete duplicated

* fix comment

* fix docs

* fix type

Co-authored-by: zhangshilong <2392587229zsl@gmail.com>

* support onnx export for fcos

* support onnx export for fcos fsaf retina and ssd

* resolve comments

* resolve comments

* add with nms

* support cornernet

* resolve comments

* add default with nms

* fix trt arrange should be int

* refactor anchor head anchor free head

* add dtype to single_level_grid_priors

* atss fcos autoassign

* fovea

* fsaf free anchor

* suport more

* suport more

* support all

* resolve conversation

* fix point generator

* fix device

* change to distancecoder

* resolve conversation

* fix grid prior

* fix typos in autoassgin

* fix typos

* fix doc

Co-authored-by: Haian Huang(深度眸) <1286304229@qq.com>
jshilong added a commit that referenced this pull request Oct 26, 2021
* Refactor one-stage get_bboxes logic (#5317)

* revert batch to single

* update anchor_head

* replace preds with bboxes

* add point_bbox_coder

* FCOS add get_selected_priori

* unified anchor-free and anchor-based get_bbox_single

* update code

* update reppoints and sabl

* 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

* Unified bbox coder

* add offset

* remove point_bbox_coder.py

* fix docstr

* new interface of single_proir

* fix device

* add unitest

* add cuda unitest

* add more cuda unintest

* fix reppoints

* fix device

* update all prior

* update vfnet

* add unintest for ssd and yolo and rename prior_idxs

* add docstr for MlvlPointGenerator

* update reppoints and rpnhead

* add space

* add num_base_priors

* update some model

* update docstr

* fixAugFPN test and lint.

* Fix autoassign

* add docs

* Unified fcos decoding

* update docstr

* fix train error

* Fix Vfnet

* Fix some

* update centernet

* revert

* add warnings

* fix unittest error

* delete duplicated

* fix comment

* fix docs

* fix type

Co-authored-by: zhangshilong <2392587229zsl@gmail.com>

* support onnx export for fcos

* support onnx export for fcos fsaf retina and ssd

* resolve comments

* resolve comments

* add with nms

* support cornernet

* resolve comments

* add default with nms

* fix trt arrange should be int

* refactor anchor head anchor free head

* add dtype to single_level_grid_priors

* atss fcos autoassign

* fovea

* fsaf free anchor

* suport more

* suport more

* support all

* resolve conversation

* fix point generator

* fix device

* change to distancecoder

* resolve conversation

* fix grid prior

* fix typos in autoassgin

* fix typos

* fix doc

Co-authored-by: Haian Huang(深度眸) <1286304229@qq.com>
ZwwWayne pushed a commit that referenced this pull request Oct 28, 2021
* Refactor one-stage get_bboxes logic (#5317)

* revert batch to single

* update anchor_head

* replace preds with bboxes

* add point_bbox_coder

* FCOS add get_selected_priori

* unified anchor-free and anchor-based get_bbox_single

* update code

* update reppoints and sabl

* 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

* Unified bbox coder

* add offset

* remove point_bbox_coder.py

* fix docstr

* new interface of single_proir

* fix device

* add unitest

* add cuda unitest

* add more cuda unintest

* fix reppoints

* fix device

* update all prior

* update vfnet

* add unintest for ssd and yolo and rename prior_idxs

* add docstr for MlvlPointGenerator

* update reppoints and rpnhead

* add space

* add num_base_priors

* update some model

* update docstr

* fixAugFPN test and lint.

* Fix autoassign

* add docs

* Unified fcos decoding

* update docstr

* fix train error

* Fix Vfnet

* Fix some

* update centernet

* revert

* add warnings

* fix unittest error

* delete duplicated

* fix comment

* fix docs

* fix type

Co-authored-by: zhangshilong <2392587229zsl@gmail.com>

* support onnx export for fcos

* support onnx export for fcos fsaf retina and ssd

* resolve comments

* resolve comments

* add with nms

* support cornernet

* resolve comments

* add default with nms

* fix trt arrange should be int

* refactor anchor head anchor free head

* add dtype to single_level_grid_priors

* atss fcos autoassign

* fovea

* fsaf free anchor

* suport more

* suport more

* support all

* resolve conversation

* fix point generator

* fix device

* change to distancecoder

* resolve conversation

* fix grid prior

* fix typos in autoassgin

* fix typos

* fix doc

Co-authored-by: Haian Huang(深度眸) <1286304229@qq.com>
ZwwWayne pushed a commit to ZwwWayne/mmdetection that referenced this pull request Jul 19, 2022
* Refactor one-stage get_bboxes logic (open-mmlab#5317)

* revert batch to single

* update anchor_head

* replace preds with bboxes

* add point_bbox_coder

* FCOS add get_selected_priori

* unified anchor-free and anchor-based get_bbox_single

* update code

* update reppoints and sabl

* 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

* Unified bbox coder

* add offset

* remove point_bbox_coder.py

* fix docstr

* new interface of single_proir

* fix device

* add unitest

* add cuda unitest

* add more cuda unintest

* fix reppoints

* fix device

* update all prior

* update vfnet

* add unintest for ssd and yolo and rename prior_idxs

* add docstr for MlvlPointGenerator

* update reppoints and rpnhead

* add space

* add num_base_priors

* update some model

* update docstr

* fixAugFPN test and lint.

* Fix autoassign

* add docs

* Unified fcos decoding

* update docstr

* fix train error

* Fix Vfnet

* Fix some

* update centernet

* revert

* add warnings

* fix unittest error

* delete duplicated

* fix comment

* fix docs

* fix type

Co-authored-by: zhangshilong <2392587229zsl@gmail.com>

* support onnx export for fcos

* support onnx export for fcos fsaf retina and ssd

* resolve comments

* resolve comments

* add with nms

* support cornernet

* resolve comments

* add default with nms

* fix trt arrange should be int

* refactor anchor head anchor free head

* add dtype to single_level_grid_priors

* atss fcos autoassign

* fovea

* fsaf free anchor

* suport more

* suport more

* support all

* resolve conversation

* fix point generator

* fix device

* change to distancecoder

* resolve conversation

* fix grid prior

* fix typos in autoassgin

* fix typos

* fix doc

Co-authored-by: Haian Huang(深度眸) <1286304229@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants