深度学习计算数据集里所有图像像素点的均值方差

代码怕忘记,现在贴上来,以防丢失

from torch.utils.data import DataLoader
from torchvision.datasets import ImageFolder
import torch
from torchvision import transforms

def get_mean_and_std(data_path, in_chans=3):
    dataset = ImageFolder(root=data_path, transform=transforms.ToTensor()

你可能感兴趣的:(深度学习,均值算法,人工智能)