Solved by mukul54 in post #2 
              
              
                I got the answer and really sorry for posting the doubt without doing more work which I should have done. 
Initially, I thought that converting images to tensor is distorting my mask, which is not because I am using torch.from_numpy. It was because of resizing. It seems default interpolation in tran…