summaryrefslogtreecommitdiff
path: root/test.py
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-04-19 02:27:58 +0200
committerJules Laplace <julescarbon@gmail.com>2018-04-19 02:27:58 +0200
commitdd006ec9e3a4dfd611f82deb399c3f5071a4e7b3 (patch)
tree59cc02813b26d70a4881e33f9b7e5fd22d2a0a56 /test.py
parent3ab9c12e08ae9af0e92d12a8838e7683360afe7f (diff)
test
Diffstat (limited to 'test.py')
-rw-r--r--test.py48
1 files changed, 24 insertions, 24 deletions
diff --git a/test.py b/test.py
index f40793a..2a60a65 100644
--- a/test.py
+++ b/test.py
@@ -24,31 +24,31 @@ if __name__ == '__main__':
mkdirs(render_dir)
copyfile(opt.start_img, render_dir + "frame_00000.png")
- data_loader = CreateRecursiveDataLoader(opt)
- dataset = data_loader.load_data()
- ds = dataset.dataset
- model = create_model(opt)
- visualizer = Visualizer(opt)
- # create website
- web_dir = os.path.join(opt.results_dir, opt.name, '%s_%s' % (opt.phase, opt.which_epoch))
- webpage = html.HTML(web_dir, 'Experiment = %s, Phase = %s, Epoch = %s' % (opt.name, opt.phase, opt.which_epoch))
- # test
- print(dataset.name())
- for i, data in enumerate(data_loader):
- if i >= opt.how_many:
- break
- model.set_input(data)
- model.test()
- visuals = model.get_current_visuals()
- img_path = model.get_image_paths()
- print('%04d: process image... %s' % (i, img_path))
- ims = visualizer.save_images(webpage, visuals, img_path, aspect_ratio=opt.aspect_ratio)
- if dataset.name() == 'RecursiveDatasetDataLoader':
- last_image = opt.results_dir + opt.name + "/test_latest/images/" + ims[1]
- next_image = render_dir + "frame_{:05d}.png".format(i+1)
- move(last_image, next_image)
+ # data_loader = CreateRecursiveDataLoader(opt)
+ # dataset = data_loader.load_data()
+ # ds = dataset.dataset
+ # model = create_model(opt)
+ # visualizer = Visualizer(opt)
+ # # create website
+ # web_dir = os.path.join(opt.results_dir, opt.name, '%s_%s' % (opt.phase, opt.which_epoch))
+ # webpage = html.HTML(web_dir, 'Experiment = %s, Phase = %s, Epoch = %s' % (opt.name, opt.phase, opt.which_epoch))
+ # # test
+ # print(dataset.name())
+ # for i, data in enumerate(data_loader):
+ # if i >= opt.how_many:
+ # break
+ # model.set_input(data)
+ # model.test()
+ # visuals = model.get_current_visuals()
+ # img_path = model.get_image_paths()
+ # print('%04d: process image... %s' % (i, img_path))
+ # ims = visualizer.save_images(webpage, visuals, img_path, aspect_ratio=opt.aspect_ratio)
+ # if dataset.name() == 'RecursiveDatasetDataLoader':
+ # last_image = opt.results_dir + opt.name + "/test_latest/images/" + ims[1]
+ # next_image = render_dir + "frame_{:05d}.png".format(i+1)
+ # move(last_image, next_image)
- webpage.save()
+ # webpage.save()
cmd = ("/usr/bin/ffmpeg", "-i", render_dir + "frame_%05d.png", "-c:v", "libx264", "-vf", "fps=30", "-pix_fmt", "yuv420p", render_dir + opt.name + "_" + opt.experiment + ".mp4")
process = subprocess.Popen(cmd, stdout=subprocess.PIPE)