The official implementation of the accepted IEEE-TIP paper Conditional Boundary Loss for Semantic Segmentation.
We provide the code of our CBL based on our_maskformer and MMsegmentation.
The whole CBL MMsegmentation code base will be uploaded soon. For now, your can use our CBL in MMsegmentation following the instructions down below.
More results of other models like Swin-B and PSP, together with the trained model weights file, will be updated soon once we finished the orgnization of our project.
Temporary result table:
model | Backbone | iter | Crop Size | mIoU MMseg (single scale) | mIoU +CBL Ours (single scale) |
---|---|---|---|---|---|
OCRNet | HRNetW48 | 80K | 512x1024 | 80.70 | 81.95 |
model | Backbone | mIoU(SS) | mIoU(MS) |
---|---|---|---|
MaskFormer | Swin-B | -- | 53.83(official) |
MaskFormer +CBL | Swin-B | 53.49 | 54.89 Trained Model Code:CBL0 |
Mask2Former | Swin-B | -- | 55.07(official) |
Mask2Former +CBL | Swin-B | 54.79 | 56.05 Trained Model Code:CBL0 |
We build our implementation based on the official code base of MaskFormer. Please refer to our MaskFormer code base at our_maskformer This implementation enables easy reproduction of our CBL on MaskFormer, which do not need the above complicated steps for mmsegmentation. The trained MaskFormer+CBL model can also be found at MaskFormer+CBL Trained Model Code:CBL0 The trained Mask2Foremer+CBL model is also provided at Mask2Former+CBL Trained Model Code:CBL0
We follow the implementation of MMsegmentation. Here we provide the code of CBL based on the OCRHead in CBLocr_head.py.
The class name of the OCRHead with our CBL is New_ER5OCRHead
.
from .ocr_head import OCRHead
as from .ocr_head import OCRHead, New_ER5OCRHead
from .biou import multi_class_gt_to_boundary
'multi_class_gt_to_boundary'
to the list of __all__ = [xxx]
from .boundary import GenerateBoundary
'GenerateBoundary'
to the list of __all__ = [xxx]
sh tools/dist_train.sh YOUR_PATH_TO_THE_CONFIG/erocrnet_hr48_512x1024_80k_cityscapes_fp16.py 8
1.Upload the whole CBL project based on MMsegmentation (including CBL trained models with PSPNet, DeeplabV3+, Swin-B)
2.~Upload the whole CBL project based on MaskFormer (including CBL trained models with MaskFormer)~ (Done)
3.Write a new instruction about how to run our CBL on the above-mentioned projects.