diff options
| -rw-r--r-- | options/dataset_options.py | 6 | ||||
| -rw-r--r-- | test-mogrify-recursive.sh | 13 | ||||
| -rw-r--r-- | test-mogrify.py | 9 |
3 files changed, 26 insertions, 2 deletions
diff --git a/options/dataset_options.py b/options/dataset_options.py index b4a3274..e1ef153 100644 --- a/options/dataset_options.py +++ b/options/dataset_options.py @@ -47,6 +47,12 @@ class DatasetOptions(BaseOptions): ) self.parser.add_argument( + '--render-frames', + action='store_true', + help='render the source frames only' + ) + + self.parser.add_argument( '--tag', type=str, default="", diff --git a/test-mogrify-recursive.sh b/test-mogrify-recursive.sh index 500cf86..71050ea 100644 --- a/test-mogrify-recursive.sh +++ b/test-mogrify-recursive.sh @@ -30,6 +30,19 @@ python test-mogrify.py \ # --clahe --process-frac 0.001 \ # --sequence --sequence-frac 0.49 \ +python test-mogrify.py \ + --dataroot "$dataset/train/" \ + --start_img "$dataset/test/frame_00003.png" \ + --experiment "${tag}_sequence_process_less" \ + --name pcfade \ + --sequence --sequence-frac 0.999 \ + --loadSize 256 --fineSize 256 --how_many $how_many \ + --model test --which_model_netG unet_256 \ + --which_direction AtoB --dataset_mode recursive \ + --recursive --recursive-frac 0.0005 \ + --norm batch --tag "pcfade_spin_sequence_process_less_201805150450" \ + --render-frames --mov + # python test-mogrify.py \ # --dataroot "$dataset/train/" \ # --start_img "$dataset/test/frame_00003.png" \ diff --git a/test-mogrify.py b/test-mogrify.py index 2c636d9..61f9899 100644 --- a/test-mogrify.py +++ b/test-mogrify.py @@ -104,9 +104,14 @@ if __name__ == '__main__': def render_video(): print(opt.render_dir) - video_fn = tag + "_mogrify.mp4" + if opt.render_frames: + frame_fn = "frame_%05d.png" + video_fn = tag + "_mog_frame.mp4" + else + frame_fn = "ren_%05d.png" + video_fn = tag + "_mogrify.mp4" - cmd = ("ffmpeg", "-i", render_dir + "ren_%05d.png", "-y", "-c:v", "libx264", "-vf", "fps=30", "-pix_fmt", "yuv420p", "-s", "456x256", render_dir + video_fn) + cmd = ("ffmpeg", "-i", render_dir + frame_fn, "-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() |
