Resize images (torch.Tensor) already loaded on GPU keeping their aspect ratio

Hi @ptrblck,

I think you might be right, the background color should be correct. Thank you for helping with this.

I am sorry I think I failed to specify that the system can technically work with images of any size. Tall, wide, with different proportions. If I am not mistaken, the 91 and 325 numbers are hard coded for the 1080, 1920 case. Could we somehow use the new dimensions I am calculating to generalize this step, so it works with images of any random size?

UPDATE: Done. Everything’s working.

Thank you for your help and time!

Eugene

1 Like