cvlab-stonybrook / SAMPath

Repository for "SAM-Path: A Segment Anything Model for Semantic Segmentation in Digital Pathology" (MedAGI2023, MICCAI2023 workshop)
28 stars 6 forks source link

The correspondence between class id and class name #15

Closed zhi-xuan-chen closed 2 weeks ago

zhi-xuan-chen commented 3 weeks ago

Hello, can you provide a dict contains the correspondence between your class id and class name. Since you merge the original class, so maybe the correspondence has been changed.

jingweizhang-xyz commented 3 weeks ago

Refer to #3

zhi-xuan-chen commented 3 weeks ago

OK, thanks. And for the correspondance of the CRAG dataset, have you already provided?

jingweizhang-xyz commented 3 weeks ago

It should be glands:2 and background:1. Class 0 is for unlabeled region where there should be no losses and it was not used in the CRAG dataset.

zhi-xuan-chen commented 3 weeks ago

OK! But the mask will contain 0, 1, 2, right?

zhi-xuan-chen commented 3 weeks ago

And what is the difference between mask and mask_org of the CRAG? I am not sure about what is the main change when instance dataset converted into semantic dataset.

jingweizhang-xyz commented 3 weeks ago

The mask in the files are 0 (background) and 1 (gland) and in the data-loading process, they are processed by adding 1. In the instance dataset, if there are 10 glands in one image, these glands will have label from 1 to 10. While in the semantic image, all these glands are of label 1.

zhi-xuan-chen commented 3 weeks ago

Thank you! So, it seems there are only two classes in the mask file, why not just use these two classes to compute loss instead of ignore index 0 after adding 1. And Can I assume that in a mask, there are only two values, 1 and 0, and there is no third value?

jingweizhang-xyz commented 3 weeks ago

Yes, it should be.

zhi-xuan-chen commented 3 weeks ago

OK, thank you very much.