mIou import torch import numpy as np def Iou(input,target,classNum): ''' :param input: [b,h,w] :param target: [b,h,w] :param classNum: scalar :return: ''' inputTmp = torch.zeros([input.shape[0],classNum,input.shape[1],input.shape[2]])#创建[b,c,h,w]大小的0矩阵 targetTmp = to