上传者: 38750406
|
上传时间: 2022-03-29 16:43:27
|
文件大小: 18KB
|
文件类型: -
import torch as t
from torch.utils import data
import os
from PIL import Image
import numpy as np
import torchvision.transforms as T
transforms = T.Compose([
T.Resize(224),
T.CenterCrop(224),
T.ToTensor(),
T.Normalize(mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5))
])
# 继承Dataset类要重写__getitem__