-
Notifications
You must be signed in to change notification settings - Fork 11
/
test.py
25 lines (20 loc) · 649 Bytes
/
test.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
from data.data_loader import CreateDataLoader
from options.test_options import TestOptions
from models.models import create_model
import numpy as np
import torch
if __name__=='__main__':
# get testing options
opt = TestOptions().parse()
# creat a dataset
data_loader = CreateDataLoader(opt)
dataset = data_loader.load_data()
print(len(dataset))
dataset_size = len(dataset) * opt.batchSize
print('testing images = %d' % dataset_size)
# create a model
model = create_model(opt)
with torch.no_grad():
for i, data in enumerate(dataset):
model.set_input(data)
model.test()