real_img = real_input_img.squeeze(0).permute(2, 1, 0).cpu().numpy()
syn_img = label_img.squeeze(0).permute(2, 1, 0).cpu().numpy()
mean_gray_real = cv2.cvtColor(real_img.astype(np.float32), cv2.COLOR_BGR2GRAY).mean()
mean_gray_syn_high = cv2.cvtColor(syn_img.astype(np.float32), cv2.COLOR_BGR2GRAY).mean()
real_img_adjust = np.clip(real_img * (mean_gray_syn_high / mean_gray_real), 0, 1)
real_img_adjust = torch.from_numpy(real_img_adjust).permute(2, 0, 1).unsqueeze(0).to(device)
real_img = real_input_img.squeeze(0).permute(2, 1, 0).cpu().numpy()标签:11,real,img,gray,cv2,syn,mean From: https://www.cnblogs.com/yyhappy/p/18064778
syn_img = label_img.squeeze(0).permute(2, 1, 0).cpu().numpy()
mean_gray_real = cv2.cvtColor(real_img.astype(np.float32), cv2.COLOR_BGR2GRAY).mean()
mean_gray_syn_high = cv2.cvtColor(syn_img.astype(np.float32), cv2.COLOR_BGR2GRAY).mean()
real_img_adjust = np.clip(real_img * (mean_gray_syn_high / mean_gray_real), 0, 1)
real_img_adjust = torch.from_numpy(real_img_adjust).permute(2, 0, 1).unsqueeze(0).to(device)