SPNet
SPNet copied to clipboard
where you ignore labels of pixels belonging to unseen classes during training
Thank you for sharing the useful code.
@subhc , as you discussed in article you consider all images during training, but pixels which relate to unseen classes will be ignored in calculating loss.
I completely explore your codes, but all classes are considered ( 0 to 15 for seen and 16 to 20 for unseen) for calculating loss.
I checked target tensor in this part which calculate loss. Some times in target we have pixels relate to unseen classes ( index from 16 to 20), but they are not ignored for calculating loss.
for output in outputs:
# Resize target for {100%, 75%, 50%, Max} outputs
target_ = resize_target(target, output.size(2))
target_ = torch.tensor(target_).to(device)
loss += criterion.forward(output, target_)
Thank you for your answer