Hi all! I am following this 9 tutorial on finetuning an object detector. As one of the steps, I split my mask image into separate masks and filter out masks corresponding to unwanted labels. Afterwards, I would like to merge the masks back into one channel and display it as a PIL image. The problem is: I cannot for the life of me figure out how to do this!
I’ve tried torch.cat, but this increases the size of the image in one dimension. E.g.: torch.cat(t, dim=1), where t.shape == (2,640,230) creates a tensor of size (640,460), while what I want is a tensor of size (640,230) with the values of the respective channels in the correct positions. The masks do not overlap at all, so I feel like this should be possible.
Any help is much appreciated, and if there are questions please let me know!