dywu98 / CBL-Conditional-Boundary-Loss

The official implementation of IEEE-TIP paper under review
12 stars 4 forks source link

Unable to understand how to use the code for CBL #4

Open it-is-lokesh opened 4 months ago

it-is-lokesh commented 4 months ago

Hi, thank you for such a great methodology. We are trying to understand your code given in the repository but unable to comprehend what the loss function takes in as parameters. Can you kindly give the path to the loss function code along with the description/steps to use the same in a custom segmentation model? Thanks

dywu98 commented 4 months ago

Thanks for the attention on our work.

First, we recommend you to directly use the maskformer or mask2former code, since we have provide detailed instruction on how to train a maskformer or mask2former model with our CBL loss. Be sure to run the train_net_biou.py with CBL instead of the original train_net.py for the plain maskformer and mask2former.

Second, the loss function takes the predicted logits, mid feature maps, ground truth, and boundary mask as inputs. Each element in the boundary mask is 0 or 1 which indicates whether the pixel is or is not located in the boundary areas. You can find the CBL code for mask2former at here. We generate the boundary mask for mask2former with the data processing pipeline in this code For mmsegmentation, your can refer to here with the code to generate the boundary mask. The dilation rate in it controls the width of the boundary.

The steps to train a OCRNet model in mmsegmentation is listed in the readme.md. Sorry for the poor and confusing description. If you need the full mmsegmentation code, please leave an e-mail address so that I can send you a version for Swin-B-UpperNet+CBL which can run directly but no longer supported by the latest openmmlab segmentation repo.

it-is-lokesh commented 4 months ago

Thanks a lot for the reply. It solves all my queries and I request you to add the links to the CBL code for mask2former and boundary mask extractor in the README file, so that I helps anyone in the future who is using the code. Please send the code for Swin-B-UpperNet+CBL, it would help us in understanding the loss. Here is my email id: g.sailokesh9@gmail.com Thanks again!

yamyCD commented 1 month ago

Hello,

Thank you for the detailed response. I am also interested in obtaining the complete code, especially the parts related to mask2former and boundary mask extractor for CBL. It would be very helpful for understanding the loss function and implementing it.

Could you please send me the Swin-B-UpperNet+CBL version of the code as well? My email is: jlove1146@163.com.

Thank you very much!

dywu98 commented 1 month ago

Hello,

Thank you for the detailed response. I am also interested in obtaining the complete code, especially the parts related to mask2former and boundary mask extractor for CBL. It would be very helpful for understanding the loss function and implementing it.

Could you please send me the Swin-B-UpperNet+CBL version of the code as well? My email is: jlove1146@163.com.

Thank you very much!

Code sent. Please check your email. Feel free to ask if you have any question.