Hello everyone,
Could anyone give me a hand with the following please.
Context: I am working on a system that processed videos. I take N frames, .cat() them in a batch and move to GPU.
Then, I want to run this batch through a neural net (YOLO). In order to do it, I need to resize each image in the batch to the standard 416 x 416 size keeping the aspect ratio. The main problem here - I cannot move it back to CPU, we’re trying to minimize host-device data transfers, so it needs to be done directly on GPU.
Could anyone please explain how to do it?
What I am doing now:

I am looping over my torch.Tensor (batch of images on GPU) and want to resize each tensor separately. I am sure there’s a better way to do it all together.
image1076×508 31.4 KB
This is obviously not working.

Thank you in advance!
Eugene