mmsegmentation icon indicating copy to clipboard operation
mmsegmentation copied to clipboard

[Fix] Support MaskFormer.

Open wanghao9610 opened this issue 3 years ago • 3 comments

Motivation

Add MaskFormer to mmseg.

Modification

  • add 'ToMask' formatting operator to train pipeline to generate the 'gt_masks' and 'gt_labels'.
  • change 'DefaultFormatBundle' class to adapt to new keys ' gt_masks' and 'gt_labels'.
  • change 'EncoderDecoder' forward_train input elements (adding **kwargs to match the maskformer input demand).
  • add 'maskformer_head', reference with the implementation of mmdet.
  • change 'dice_loss' and 'focal_loss' reference with them on mmdet, the original dice_loss will lead the out_of_memory error because of the F.one_hot function when num_class is large.
  • add 'plugin' subdirectory simply adding other modules, such as PixelDecoder, TransformerEncodePixelDecoder.
  • add 'MaskHungarianAssigner' to do mask bipartite matching, reference with mmdet.
  • add 'positional_encoding' and 'transformer', reference with mmdet.
  • add some configs of maskformer:
    • maskformer_r50_512x512_80k_ade20k.py
    • maskformer_r50_512x512_160k_ade20k.py
    • maskformer_swin-t-p4-w7_512x512_160k_ade20k.py

wanghao9610 avatar Dec 18 '21 13:12 wanghao9610

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


wanghao seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Dec 18 '21 13:12 CLAassistant

Based on our inner discussion, we would like to use MaskFormer module directly from MMDetection, rather than making a lot of code copy to MMSegmentation. We would support MaskFormer as soon as possible.

MengzhangLI avatar Mar 04 '22 07:03 MengzhangLI

Hi, is there any plan to support Mask2former in semantic segmentation?

wmkai avatar May 30 '22 12:05 wmkai

Hi @wanghao9610!We are grateful for your efforts in helping improve this open-source project during your personal time. Welcome to join OpenMMLab Special Interest Group (SIG) private channel on Discord, where you can share your experiences, ideas, and build connections with like-minded peers. To join the SIG channel, simply message moderator— OpenMMLab on Discord or briefly share your open-source contributions in the #introductions channel and we will assist you. Look forward to seeing you there! Join us :https://discord.gg/UjgXkPWNqA If you have a WeChat account,welcome to join our community on WeChat. You can add our assistant :openmmlabwx. Please add "mmsig + Github ID" as a remark when adding friends:) Thank you again for your contribution❤ @wanghao9610

OpenMMLab-Assistant003 avatar Apr 12 '23 08:04 OpenMMLab-Assistant003