-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi-label Segmentation #51
Comments
You should remove those lines with mask if you are converting it to multi-class problem. Your ground truth should just contain pixels of values 0,1,2,3 if you are working on a 3-class classification problem. |
Could you please explain what does these lines(189-192) do in train.py? tmp[tmp>=0.5] = 1 and also why you do this(205-206)? I have to remove these lines for my case, right? |
请问这个你是用的哪个数据集 |
@shanpriya3, the code in lines 189-192 applies an aggressive softmax - i.e. translate all predictions into binary format (either 0 or 1) to then store the mask in the format described in the repository's Readme (values 255 correspond to the object, 0 to the background). Lines 205-206 are needed for the mask saving format described in the repository:
Then, as @jeya-maria-jose mentioned, instead of modifying the mask, you need to remove these lines and assume that gt(ground truth) should contain integer values of object classes (0, 1 or 2 in this case), also for a simpler interpretation, it is easier to save the predictions of the validation set not only for the 1st channel, i.e. maybe change line 214 to |
Hello, I have a question, in training, |
Hi, I have a ground-truth with 3 classes including background with values 0,127,255. As mentioned in #43 I changed num_classes=3 in axialnet.py
In utils.py,
Medical-Transformer/utils.py
Lines 156 to 157 in 703a080
which makes the ground-truth with values 0 and 1 but I should have 0,1 and 2 for my case(with 3 classes).
I tried doing this
mask[mask<127] = 0
mask[mask==127] = 1
mask[mask>127] = 2
But I got this error. Could you please help me with this?
![image](https://user-images.githubusercontent.com/26112565/136808759-6b3d1d6a-fd43-4d88-9757-172542048f6d.png)
The text was updated successfully, but these errors were encountered: