-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathrun_test.py
More file actions
24 lines (20 loc) · 714 Bytes
/
run_test.py
File metadata and controls
24 lines (20 loc) · 714 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import os
from arguments import Arguments
from data import CreateDataLoader
from models import create_model
from util import save_images
if __name__ == '__main__':
args = Arguments().parse()
data_loader = CreateDataLoader(args)
dataset = data_loader.load_data()
model = create_model(args)
for i, data in enumerate(dataset):
if i >= args.how_many:
break
model.set_input(data)
model.test()
visuals = model.get_current_visuals()
img_path = model.get_image_paths()
img_size = model.get_image_sizes()
print('%04d: processing image... %s' % (i, img_path))
save_images(args.results_dir, visuals, img_path, size=img_size)