diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-04-20 11:56:56 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-04-20 11:56:56 +0200 |
| commit | f3dac7ce89a872eb40aca3fae7866c224cd494b3 (patch) | |
| tree | 180bbde6dcfb4f830c2973fdaf454079414d467b | |
| parent | aaa0590b97f343f3fd79f2fbd6c4ac840af19ff4 (diff) | |
try resizing
| -rwxr-xr-x | recursive.sh | 3 | ||||
| -rw-r--r-- | test.py | 14 |
2 files changed, 10 insertions, 7 deletions
diff --git a/recursive.sh b/recursive.sh index 31f34da..cdaad73 100755 --- a/recursive.sh +++ b/recursive.sh @@ -4,8 +4,9 @@ python test.py \ --start_img /home/lens/Desktop/thumbs/woodscaled/A/train/frame_0000.png \ --how_many 2000 \ --model test \ - --aspect_ratio 1.777777 \ --which_model_netG unet_256 \ --which_direction AtoB \ --dataset_mode recursive \ --norm batch + +# --aspect_ratio 1.777777 \ @@ -6,11 +6,12 @@ from util.visualizer import Visualizer from util.util import mkdirs from util import html from shutil import move, copyfile +from scipy.misc import imresize +from PIL import Image, ImageOps import subprocess from time import sleep - if __name__ == '__main__': opt = TestOptions().parse() opt.nThreads = 1 # test code only supports nThreads = 1 @@ -44,14 +45,15 @@ if __name__ == '__main__': 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) - + im = visuals['fake_B'] + save_path = render_dir + "frame_{:05d}.png".format(i+1) + im = imresize(im, 248, 248, interp='bicubic') + im = ImageOps.expand(im, (4,4,4,4)) + util.save_image(im, save_path) webpage.save() os.remove(render_dir + "frame_00000.png") - + 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) output, error = process.communicate() |
