diff options
| -rwxr-xr-x | build_dataset.pl | 4 | ||||
| -rwxr-xr-x | dir-to-movie.pl | 20 | ||||
| -rwxr-xr-x | options/base_options.py | 2 |
3 files changed, 14 insertions, 12 deletions
diff --git a/build_dataset.pl b/build_dataset.pl index 2780d77..f007038 100755 --- a/build_dataset.pl +++ b/build_dataset.pl @@ -46,11 +46,11 @@ for ($i = 0; $i < $count; $i++) { } $src = $images_dir . $images[$i]; - $dst = $dir . sprintf("A/frame%05d.png", $i); + $dst = $dir . sprintf("A/frame_%05d.png", $i); system("ln", "-s", $src, $dst); $src = $images_dir . $images[$i+1]; - $dst = $dir . sprintf("B/frame%05d.png", $i); + $dst = $dir . sprintf("B/frame_%05d.png", $i); system("ln", "-s", $src, $dst); if (($i % 100) == 0) { diff --git a/dir-to-movie.pl b/dir-to-movie.pl index 8d386df..8648be2 100755 --- a/dir-to-movie.pl +++ b/dir-to-movie.pl @@ -1,28 +1,30 @@ #!/usr/bin/perl +my $tag = $ARGV[0] or "pix2pixhd_" . time; + my $i = 0; my $ls = `ls -1v *.png`; my @lines = split('\n', $ls); - -mkdir('./tmp'); - my $pwd = `pwd`; chomp $pwd; $pwd .= '/'; print $pwd . "\n"; +mkdir('./tmp'); + for my $line (@lines) { chomp $line; system('ln', '-s', $pwd . $line, sprintf('./tmp/frame_%05d.png', $i)); $i += 1; } -my $tag = $ARGV[0]; -if (!$tag) { - $tag = 'movie'; -} -system("ffmpeg", "-i", "./tmp/frame_%05d.png", "-y", "-c:v", "libx264", "-vf", "fps=25", "-pix_fmt", "yuv420p", "-s", "1024x512", $tag . ".mp4"); +system("ffmpeg", + "-i", "./tmp/frame_%05d.png", + "-y", "-c:v", "libx264", "-vf", "fps=25", "-pix_fmt", "yuv420p", + "-s", "1024x512", + $tag . ".mp4" +); END { -# system('rm', '-rf', 'tmp'); + system('rm', '-rf', 'tmp'); } diff --git a/options/base_options.py b/options/base_options.py index d735bd9..342f503 100755 --- a/options/base_options.py +++ b/options/base_options.py @@ -18,7 +18,7 @@ class BaseOptions(): self.parser.add_argument('--model', type=str, default='pix2pixHD', help='which model to use') self.parser.add_argument('--norm', type=str, default='instance', help='instance normalization or batch normalization') self.parser.add_argument('--use_dropout', action='store_true', help='use dropout for the generator') - self.parser.add_argument('--experiment', type=str, default='label2city', help='another place to name the experiment.') + self.parser.add_argument('--experiment', type=str, default='label2city', help='another place to name the experiment when generating...') # input/output sizes self.parser.add_argument('--batchSize', type=int, default=1, help='input batch size') |
