queryinst.py 1000 B

1234567891011121314151617181920212223242526272829
  1. # Copyright (c) OpenMMLab. All rights reserved.
  2. from mmdet.registry import MODELS
  3. from mmdet.utils import ConfigType, OptConfigType, OptMultiConfig
  4. from .sparse_rcnn import SparseRCNN
  5. @MODELS.register_module()
  6. class QueryInst(SparseRCNN):
  7. r"""Implementation of
  8. `Instances as Queries <http://arxiv.org/abs/2105.01928>`_"""
  9. def __init__(self,
  10. backbone: ConfigType,
  11. rpn_head: ConfigType,
  12. roi_head: ConfigType,
  13. train_cfg: ConfigType,
  14. test_cfg: ConfigType,
  15. neck: OptConfigType = None,
  16. data_preprocessor: OptConfigType = None,
  17. init_cfg: OptMultiConfig = None) -> None:
  18. super().__init__(
  19. backbone=backbone,
  20. neck=neck,
  21. rpn_head=rpn_head,
  22. roi_head=roi_head,
  23. train_cfg=train_cfg,
  24. test_cfg=test_cfg,
  25. data_preprocessor=data_preprocessor,
  26. init_cfg=init_cfg)