I am running inference with a regression model in fastai that takes in images and predicts several (x,y) coordinates:

x, y, _, _ = model.predict(image, return_x=True)

I would like to be able to plot x and y externally, i.e., I need them in regular image format.

For x, I just do torchvision.transforms.ToPILImage(mode=‘RGB’)(img.data).

However, I can’t seem to figure out how to convert the y (coordinate tensor).

I can’t use fastai’s image.show(y=y) in this case (which works fine when I’m in Jupyter Notebooks).

Thanks for any help!