yiyixuxu / polyloss-pytorch

Implementing PolyLoss in Pytorch
72 stars 13 forks source link

Poly Loss image segmentation #3

Closed Ehteshamciitwah closed 2 years ago

Ehteshamciitwah commented 2 years ago

Hello, Thank you for your work. I want to use the poly loss for image segmentation. I have input [B,C,H,W] and mask as [B,H,W]. I have ignore_indexes too in masks. how can I use your provided loss function correctly? Thank you

yiyixuxu commented 2 years ago

Hi:

  1. ignore_indexes is not supported here.
  2. if you have input [B,C,H,W] and mask [B,H,W]- you can insert a channel dimension of size 1 in your mask, do mask[:,None,...] or mask.unqueeze(1)( learn more about unsqueeze here https://pytorch.org/docs/stable/generated/torch.unsqueeze.html)
flower-me commented 2 years ago

Would you like to know if you have successfully applied image segmentation and how to do it? Thank you.

yiyixuxu commented 2 years ago

@flower-me here is an example where I applied on segmentation for medical images

https://wandb.ai/yiyixu/BTCV/reports/PolyLoss-for-Multi-organ-Segmentation-Task--VmlldzoxOTk3Nzg1

notebook here: https://colab.research.google.com/gist/yiyixuxu/82e2878a6e688e167d2b665928e41cc7/polyloss_unetr_btcv_segmentation_3d_w-b.ipynb

flower-me commented 2 years ago

First of all, thank you very much for your help, but I can't get the link to this notebook. Can you share it again

------------------ 原始邮件 ------------------ 发件人: "yiyixuxu/polyloss-pytorch" @.>; 发送时间: 2022年6月7日(星期二) 凌晨0:40 @.>; 抄送: "杨海红 @.**@.>; 主题: Re: [yiyixuxu/polyloss-pytorch] Poly Loss image segmentation (Issue #3)

@flower-me here is an example where I applied on segmentation for medical images

https://wandb.ai/yiyixu/BTCV/reports/PolyLoss-for-Multi-organ-Segmentation-Task--VmlldzoxOTk3Nzg1

notebook here: https://colab.research.google.com/gist/yiyixuxu/82e2878a6e688e167d2b665928e41cc7/polyloss_unetr_btcv_segmentation_3d_w-b.ipynb

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>