diff options
| author | jules on spawn <spawn@cortex> | 2018-04-10 02:02:13 +0200 |
|---|---|---|
| committer | jules on spawn <spawn@cortex> | 2018-04-10 02:02:13 +0200 |
| commit | 001c18201e06b0740b8aff7d7a613bb1dcb93553 (patch) | |
| tree | f83ab5f5897fd23ff81276d003ac03b0ad350200 | |
| parent | 630c245ad0d42ab4a83198c4c04f78feaa1a0428 (diff) | |
script to list latest files
| -rw-r--r-- | latest.pl | 49 | ||||
| -rwxr-xr-x | mix.sh | 2 |
2 files changed, 51 insertions, 0 deletions
diff --git a/latest.pl b/latest.pl new file mode 100644 index 0000000..b20ca1c --- /dev/null +++ b/latest.pl @@ -0,0 +1,49 @@ +#!/usr/bin/perl + +use strict; +use Getopt::Std; + +our $opt_l; +getopts('l'); + +# my $s = "results/exp:03_responses-frame_sizes:8,2-n_rnn:2-dataset:03_responses/checkpoints/best-ep1-it1035"; +sub process($){ + my ($dir) = @_; + my @exp = split(":", $dir); + my $name = $exp[4]; + my $ep; + my $path = "results/" . $dir . "/"; + my $chex = $path . "checkpoints/"; + return 0 unless -e $chex; + opendir DIR, $chex or die $!; + while (readdir DIR) { + next unless /^ep/; + $ep = $_; + last; + } + closedir DIR; + + my @epoch = split("-", $ep); + $name .= "-" . $epoch[0]; + + if (-e "output/" . $name . ".mp3") { + return 1; + } + + print $name . "\n"; + if ($opt_l) { + return 0; + } + system('/bin/bash', 'mix.sh', $path, $name); + return 0; +} + +opendir RESULTS, ("results/") or die $!; +my @results = sort {(stat $a)[10] <=> (stat $b)[10]} readdir(RESULTS); +closedir RESULTS; + +for my $result (@results) { + next if $result !~ /exp:/; + my $rv = process($result); + #last if $rv; +} @@ -9,6 +9,8 @@ dir=$1 name=$2 now=`date +'%Y%m%d'` +echo "rendering $name" + cd "$dir/samples" mkdir "$name" ../../xfade.sh |
