图像需要在通过网络传播之前进行归一化
def normalize(image: np.ndarray) -> np.ndarray: image = image.astype(np.float32) mean = (0.485, 0.456, 0.406) std = (0.229, 0.224, 0.225) image /= 255.0 image -= mean image /= std return image