How to get RGB value of a value from model output in Pytorch

Hello Team,

After getting model output i need to get dominant color of an image from(i.e RGB value of image) to calculate loss with the RGB value .

Can you please suggest how to do in pytorch ,I could do the same using open cv.
But how to via Tensors