-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathtest_datasets.py
27 lines (25 loc) · 946 Bytes
/
test_datasets.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from data_loader import load_infinite,get_AD_dataset
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms
import pdb
resize = 256
data_transforms = transforms.Compose([
transforms.Resize((resize, resize)),
transforms.ToTensor(),
])
gt_transforms = transforms.Compose([
transforms.Resize((resize, resize)),
transforms.ToTensor()])
dataset = get_AD_dataset(
type='MVTecLoco',
root='data/mvtec_loco_anomaly_detection',
transform=data_transforms,
gt_transform=gt_transforms,
phase='test',
category='breakfast_box'
)
train_dataloader = DataLoader(dataset,batch_size=1,shuffle=True,num_workers=0)
dataiter = load_infinite(train_dataloader)
data = next(dataiter)
pdb.set_trace()
# print(data)