diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-05-15 03:25:46 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-05-15 03:25:46 +0200 |
| commit | 7d23842225e871366a77901471b365984db8ef79 (patch) | |
| tree | 26fb3a127ccc580ba5cb2f0a2bd8e8717fa7a443 /test-mogrify.py | |
| parent | 2f30ea306d5890cd904fb4a6d892fc1a4a4f67e6 (diff) | |
test
Diffstat (limited to 'test-mogrify.py')
| -rw-r--r-- | test-mogrify.py | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/test-mogrify.py b/test-mogrify.py index 7cb9f05..12e042e 100644 --- a/test-mogrify.py +++ b/test-mogrify.py @@ -14,6 +14,7 @@ from shutil import copyfile, rmtree import numpy as np import cv2 from datetime import datetime +import re import subprocess from time import sleep @@ -28,11 +29,11 @@ if __name__ == '__main__': opt.experiment = data_opt.experiment # opt.start_img.split("/")[-1].split(".")[0] d = datetime.now() - tag = "{}_{}_{}_{}".format( - opt.name, opt.experiment, data_opt.experiment, + tag = "{}_{}_{}".format( + opt.name, data_opt.experiment, d.strftime('%Y%m%d%H%M')) - opt.tag = tag = "pcfade___201805150250" + opt.tag = tag # = "pcfade___201805150250" opt.render_dir = render_dir = opt.results_dir + opt.name + "/" + tag + "/" @@ -47,6 +48,11 @@ if __name__ == '__main__': copyfile(opt.start_img, render_dir + "frame_00000.png") + i_offset = 0 + numz = re.findall(r'\d+', os.path.basename(opt.start_img)) + if len(numz) > 0: + i_offset = int(numz[0]) + data_loader = CreateRecursiveDataLoader(opt) dataset = data_loader.load_data() ds = dataset.dataset @@ -89,7 +95,7 @@ if __name__ == '__main__': array_b = np.multiply(last_im.astype('float64'), frac_b) im = np.add(array_a, array_b).astype('uint8') # print(im.shape, im.dtype) - last_im = np.roll(tmp_im, 1, axis=1) + # last_im = np.roll(tmp_im, 1, axis=1) else: last_im = im.copy().astype('uint8') tmp_im = im.copy().astype('uint8') @@ -128,16 +134,15 @@ if __name__ == '__main__': print(opt.render_dir) video_fn = tag + "_mogrify.mp4" - if data_opt.mov: - cmd = ("ffmpeg", "-i", render_dir + "ren_%05d.png", "-y", "-c:v", "libx264", "-vf", "fps=30", "-pix_fmt", "yuv420p", "-s", "456x256", render_dir + video_fn) - process = subprocess.Popen(cmd, stdout=subprocess.PIPE) - output, error = process.communicate() + cmd = ("ffmpeg", "-i", render_dir + "ren_%05d.png", "-y", "-c:v", "libx264", "-vf", "fps=30", "-pix_fmt", "yuv420p", "-s", "456x256", render_dir + video_fn) + process = subprocess.Popen(cmd, stdout=subprocess.PIPE) + output, error = process.communicate() - print("________") + print("________") - cmd = ("scp", render_dir + video_fn, "jules@asdf.us:asdf/neural/") - process = subprocess.Popen(cmd, stdout=subprocess.PIPE) - output, error = process.communicate() + cmd = ("scp", render_dir + video_fn, "jules@asdf.us:asdf/neural/") + process = subprocess.Popen(cmd, stdout=subprocess.PIPE) + output, error = process.communicate() - print("https://asdf.us/neural/" + video_fn) + print("https://asdf.us/neural/" + video_fn) |
