mmdetection icon indicating copy to clipboard operation
mmdetection copied to clipboard

[Feature] Knet

Open FANG-MING opened this issue 2 years ago • 1 comments

Motivation

Add support for knet.

Modification

  1. Add MaskCost which is used in K-Net
  2. Add K-Net framework
  3. Add KernelUpdator which is used to update Kernel weight.

Use cases (Optional)

     MaskCost.

     Args:
         weight (int | float, optional): loss_weight.
         pred_act (bool): used for sigmoid.
         act_mode (str): sigmoid for binary predict,\
                            other for multi classes predict.

     Examples:
         >>> from mmdet.core.bbox.match_costs.match_cost import MaskCost
         >>> import torch
         >>> self = MaskCost()
         >>> cls_pred = torch.rand(3, 2, 3)
         >>> target = torch.rand(2, 2, 3)
         >>> self(bbox_pred, gt_bboxes)
         tensor([[-0.5636, -0.4881],
                [-0.5146, -0.4170],
                [-0.4547, -0.5371]])
    

```## Checklist

1. Pre-commit or other linting tools are used to fix the potential lint issues.
2. The modification is covered by complete unit tests. If not, please add more unit test to ensure the correctness.
3. If the modification has potential influence on downstream projects, this PR should be tested with downstream projects, like MMDet or MMCls.
4. The documentation has been modified accordingly, like docstring or example tutorials.

FANG-MING avatar Apr 05 '22 09:04 FANG-MING

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Apr 05 '22 09:04 CLAassistant