mateuszbuda / brain-segmentation-pytorch

U-Net implementation in PyTorch for FLAIR abnormality segmentation in brain MRI
https://mateuszbuda.github.io/2017/12/01/brainseg.html
MIT License
707 stars 186 forks source link

After UNet Inference, how to overlay / superimpose the different size predicted masks to the original image size? #38

Open deshwalmahesh opened 2 years ago

deshwalmahesh commented 2 years ago

Let us suppose we have an RGB image of 1024x720 and our Net inputs (and output mask) are of shape 512x512 with N classes.

So during training and inference, we need to convert our input image and mask to the desired shape of 512x512

But in real life scenario, when we are using it on Videos, images etc; we can't use the 512x512 image. Instead we need to use the original size. So how could we do this? How are we supposed to map / overlay / superimpose the predicted output mask of shape 512x512 to the input image of shape 1024x720 ?