your should transform your image to tensor and also perform normalization.
Should i use normalization on tensor?

Do you have a code/guide of Semantic segmentation?
Also, could you clarify the inputs of your function? I’m sorry I dont understand it.