voxforge.org
VoxForge Dev

Changeset 2105

Show
Ignore:
Timestamp:
04/19/07 15:27:14 (2 years ago)
Author:
kmaclean
Message:

beginning updates to Nightly Acoustic Model Creation Scripts

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Trunk/Scripts/AcousticModel_scripts/HTK/AMCreate_scripts/fix_master_prompts.pl

    r1041 r2105  
    2222###                                                               
    2323#################################################################### 
    24 if ($#ARGV != 0) { 
     24if ($#ARGV != 1) { 
    2525 print "Error: need \$targetrate parameter!\n"; 
    2626 exit; 
    2727} 
    2828$targetrate = $ARGV[0]; 
     29$prompts_file = $ARGV[0]; 
    2930 
    30 open(INPUT, "master_prompts") or die ("cannot open master_prompts for reading"); # open for input 
     31open(INPUT, "$prompts_file") or die ("cannot open $prompts_file for reading"); # open for input 
    3132open(OUTPUT, ">interim_files/master_prompts") or die ("cannot open interim_files/master_prompts for reading"); # open for output 
    3233 
  • Trunk/Scripts/Mirroring_scripts/LocalUserSubmissionValidation.pl

    r1587 r2105  
    1 #!/usr/bin/perl -w 
    21#!/usr/bin/perl -w 
    32#################################################################### 
     
    2322### 
    2423#################################################################### 
    25  
    2624use strict; 
    27 use POSIX qw(strftime); 
    28 use lib "/home/kmaclean/workspace/VoxForge/Scripts/Audio_scripts"; 
     25use lib "/home/kmaclean/VoxForge-dev/Main/Scripts/Audio_scripts"; 
    2926use UserSubmission; 
    3027my ($command, $Nightly_dirname, $Nightly_dir, $Nightly_subdir); 
    3128my ($rate, $TargetQSlindir, $TargetQSwindir); 
    32 my %parms; 
    33 $parms{"debug"} = 1; 
    34 $parms{"VoxForgeHome"} = "/home/kmaclean/workspace/VoxForge"; 
    35         $parms{"AudioDirectory"} = $parms{"VoxForgeHome"}."/Audio"; 
    36         $parms{"LexiconDirectory"} = $parms{"VoxForgeHome"}."/Lexicon"; 
    37         $parms{"QSdir"} = $parms{"VoxForgeHome"}."/QuickStart"; 
    38         $parms{"ScriptsDirectory"} = $parms{"VoxForgeHome"}."/Scripts";  
    39                 $parms{"AudioScripts_dir"} = $parms{"ScriptsDirectory"}."/Audio_scripts";        
    40                         $parms{"Repository_dir"} = $parms{"AudioScripts_dir"}."/Repository";     
    41                         $parms{"UserSubmission_dir"} = $parms{"AudioScripts_dir"}."/UserSubmission"; 
    42                 $parms{"HTK_dir"} = $parms{"ScriptsDirectory"}."/HTK/AMCreate_scripts";  
    43                 $parms{"MirroringScripts_dir"} = $parms{"ScriptsDirectory"}."/Mirroring_scripts";                        
    44 $parms{"UserSubmissions"}  = "/data/UserSubmissions"; 
    45         $parms{"QuarantineDir"} = $parms{"UserSubmissions"}."/Quarantine"; 
    46         $parms{"ToBeProcessedDir"} = $parms{"UserSubmissions"}."/ToBeProcessed"; 
    47 $parms{"HTKBin"}  = "/usr/local/HTK";  
    48  
     29use VoxForge_config;  
     30my $parms = VoxForge_config::getParms; 
    4931#################################################################### 
    5032### Main 
     
    5739#################################################################### 
    5840sub ProcessUserSubmissions { 
    59         UserSubmission::Main(\%parms) || die "UserSubmissions error: $?"; 
    60  
     41        UserSubmission::Main($parms) || die "UserSubmissions error: $?"; 
    6142} 
  • Trunk/Scripts/Mirroring_scripts/run_daily.pl

    r1612 r2105  
    2727### 0.1.4 - 2007.1.25 - added automated acoustic model 'Sanity Testing' 
    2828### 0.1.5 - 2007.1.31 - added automated metrics calculation 
     29### 0.1.6 - 2007.4.18 - accomodate svn repository changes 
    2930#################################################################### 
    3031use strict; 
    3132# !!!!!! change here for testing purposes 
    32  # use lib "/home/kmaclean/workspace/VoxForge/Scripts/Audio_scripts";  # for testing 
    33 use lib "/data/svn-mirror/Trunk/Scripts/Audio_scripts";  
     33use lib "/home/kmaclean/VoxForge-dev/Main/Scripts/Audio_scripts";  # for testing 
     34#use lib "/data/svn-mirror/Trunk/Scripts/Audio_scripts";  
    3435use UserSubmission(); 
    3536use Repository(); 
    36 #  use lib "/home/kmaclean/workspace/VoxForge/Scripts/Testing_scripts"; # for testing 
    37 use lib "/data/svn-mirror/Trunk/Scripts/Testing_scripts"; 
     37use lib "/home/kmaclean/VoxForge-dev/Main/Scripts/Testing_scripts"; # for testing 
     38#use lib "/data/svn-mirror/Trunk/Scripts/Testing_scripts"; 
    3839use Nightly_test(); 
    3940 
    40 #use lib "/home/kmaclean/workspace/VoxForge/Scripts/Metrics_scripts"; # for testing 
    41 use lib "/data/svn-mirror/Trunk/Scripts/Metrics_scripts"; 
     41use lib "/home/kmaclean/VoxForge-dev/Main/Scripts/Metrics_scripts"; # for testing 
     42#use lib "/data/svn-mirror/Trunk/Scripts/Metrics_scripts"; 
    4243use UserMetrics(); 
    4344 
    44 use POSIX qw(strftime); 
    45 my %parms; 
    46 $parms{"testing"} = 0; 
    47 $parms{"debug"} = 0; 
     45use VoxForge_config; # no paranthesis in order to import %parm into this namespace 
     46my $parms = VoxForge_config::getParms; 
     47my %parms = %$parms; 
    4848# !!!!!! 
    4949my ($dir, $command, $HTKdir, $Nightly_dirname, $Nightly_dir, $Nightly_subdir, $HTKbin); 
    50 my ($debug, $rate, $QSdir, $TargetQSlindir, $TargetQSwindir, $Audio_scriptsdir); 
     50my ($debug, $rate, $QSdir, $TargetQSlindir, $TargetQSwindir, $Audio_scriptsdir, $MirroringScripts_dir); 
    5151#################################################################### 
    5252#  parms 
    5353my $testing = $parms{"testing"} ; 
    54 if ($testing) { 
    55         $parms{"VoxForgeHome"} = "/home/kmaclean/workspace/VoxForge"; # for testing 
    56 } else { 
    57         $parms{"VoxForgeHome"} = "/data/svn-mirror/Trunk"; 
    58 } 
    59         $parms{"AudioDirectory"} = $parms{"VoxForgeHome"}."/Audio"; 
    60                 $parms{"Main_16kHz_16bit"}  =   $parms{"AudioDirectory"} . "/Main/16kHz_16bit";  
    61         $parms{"LexiconDirectory"} = $parms{"VoxForgeHome"}."/Lexicon"; 
    62         $parms{"QSdir"} = $parms{"VoxForgeHome"}."/QuickStart"; 
    63         $parms{"ScriptsDirectory"} = $parms{"VoxForgeHome"}."/Scripts";  
    64                 $parms{"AudioScripts_dir"} = $parms{"ScriptsDirectory"}."/Audio_scripts";        
    65                         $parms{"Repository_dir"} = $parms{"AudioScripts_dir"}."/Repository";     
    66                         $parms{"UserSubmission_dir"} = $parms{"AudioScripts_dir"}."/UserSubmission"; 
    67                 $parms{"HTK_dir"} = $parms{"ScriptsDirectory"}."/HTK/AMCreate_scripts";  
    68                 $parms{"MirroringScripts_dir"} = $parms{"ScriptsDirectory"}."/Mirroring_scripts";        
    69                 $parms{"Testing_scripts_dir"} = $parms{"ScriptsDirectory"}."/Testing_scripts";           
    70                                 $parms{"Nightly_test_dir"} = $parms{"Testing_scripts_dir"}."/Nightly_test";      
    71                 $parms{"Metrics_scripts_dir"} = $parms{"ScriptsDirectory"}."/Metrics_scripts";           
    72  
    73 $parms{"UserSubmissions"}  = "/data/UserSubmissions"; 
    74         $parms{"QuarantineDir"} = $parms{"UserSubmissions"}."/Quarantine"; 
    75         $parms{"ToBeProcessedDir"} = $parms{"UserSubmissions"}."/ToBeProcessed"; 
    76  
    77 # get today's date; see http://search.cpan.org/~gbarr/TimeDate-1.16/lib/Date/Format.pm for time format definitions 
    78 my $year = strftime "%Y", localtime; #%Y      year (4 digits) 
    79 my $mon = strftime "%m", localtime; # %m      month number, starting with 01 
    80 my $mday = strftime "%d", localtime; #  %d      numeric day of the month, with leading zeros (eg 01..31) 
    81 if ($testing) { 
    82         $parms{"mirror_dir"}  = "/data/svn-mirror-copy"; # for testing 
    83 } else { 
    84         $parms{"mirror_dir"}  = "/data/svn-mirror" ;  
    85 } 
    86 $parms{"Nightly_dir"}  = $parms{"mirror_dir"} . "/Nightly_Builds";  
    87         $parms{"Nightly_dirname"} = $parms{"Nightly_dir"}."/AcousticModel-$year-$mon-$mday";     
    88         $parms{"NightlyAM_16kHz_16bit"} = $parms{"Nightly_dirname"}."/HTK/16kHz_16bit/MFCC_O_D";                                 
    89         $parms{"NightlyAM_8kHz_16bit"} = $parms{"Nightly_dirname"}."/HTK/8kHz_16bit/MFCC_O_D";           
    90 $parms{"Tags"}  = $parms{"mirror_dir"} . "/Tags"; 
    91         $parms{"Releases"} = $parms{"Tags"}."/Releases";         
    92         $parms{"CurrentBuild_dir"} = $parms{"Releases"}."/0_1_1-build726"; 
    93                         $parms{"CurrentAM_16kHz_16bit"} = $parms{"CurrentBuild_dir"}."/AcousticModels/HTK/16kHz-16bit/MFCC_O_D";                                 
    94                         $parms{"CurrentAM_8kHz_16bit"} = $parms{"CurrentBuild_dir"}."/AcousticModels/HTK/8kHz-16bit/MFCC_O_D";                                   
    95  
    96 $parms{"VF_Metrics_dir"}  = "/data/mnt/domains/voxforge.org/www/public/metrics";  
    97  
    98 if ($testing) { 
    99         $parms{"HTKBin"}  = "/usr/local/HTK" ; # for testing 
    100         $parms{"JulianBin"}  = "/home/kmaclean/bin/julius-3.5.2-multipath-linuxbin/bin" ; 
    101 } else { 
    102         $parms{"HTKBin"}  = "/usr/local/bin"; 
    103         $parms{"JulianBin"}  = "/usr/local/bin";         
    104 }                        
    105 #################################################################### 
    10654$dir = $parms{"MirroringScripts_dir"}; 
    10755$HTKdir = $parms{"HTK_dir"}; 
     
    11563### Main 
    11664#################################################################### 
    117 # this still might not be done in time to take new changes in repository 
    118 &UpdateWorkingRepository() || die "UserSubmissions error: $?"; # needs to be called before "use Repository" and "use UserSubmission" scripts because need to update script repository from svn with most current versions before "using" them! 
     65UserSubmission::Main(\%parms) || die "UserSubmissions error: $?"; 
     66#Repository::Main(\%parms) || die "Repository error: $?"; 
     67#AcousticModelCreation() || die "UserSubmissions error: $?"; 
    11968 
    120 UserSubmission::Main(\%parms) || die "UserSubmissions error: $?"; 
    121 Repository::Main(\%parms) || die "Repository error: $?"; 
    122 AcousticModelCreation() || die "UserSubmissions error: $?"; 
     69#Nightly_test::Process(\%parms) || die "UserSubmissions error: $?"; 
     70#CreateTarRsynch(); 
    12371 
    124 Nightly_test::Process(\%parms) || die "UserSubmissions error: $?"; 
    125 CreateTarRsynch(); 
    126  
    127 UserMetrics::Process(\%parms) || die "UserSubmissions error: $?"; 
     72#UserMetrics::Process(\%parms) || die "UserSubmissions error: $?"; 
    12873 
    12974print STDOUT "!!!!!!run_daily completed\n"; 
     
    13176### Subroutines 
    13277#################################################################### 
    133 sub UpdateWorkingRepository() { 
    134         # Cleanup dynamically created Audio makefiles 
    135         $command = ("cd $dir && rm -f *_dyn_makefile"); print "$command\n" if $debug; system($command) == 0 or die "system $command failed: $?";  
    136         # update from svn repository server 
    137         $command = ("svn update /data/svn-mirror/Trunk"); print "$command\n" if $debug;system($command) == 0 or die "system $command failed: $?";  
    138         $command = ("svn update /data/svn-mirror/Tags/Releases"); print "$command\n" if $debug; system($command) == 0 or die "system $command failed: $?";     
    139         # reset files to executable (seems to lose this when downloading from svn) 
    140         $command = ("chmod o=rwx $dir/create_AudioMakefiles.pl"); print "$command\n" if $debug; system($command) == 0 or die "system $command failed: $?";     
    141         $command = ("chmod o=rwx $dir/create_NightlyBuildMakefiles.pl"); print "$command\n" if $debug;  system($command) == 0 or die "system $command failed: $?";     
    142         $command = ("chmod o=rwx $dir/make_all.pl"); print "$command\n" if $debug; system($command) == 0 or die "system $command failed: $?";     
    143         $command = ("chmod o=rwx $HTKdir/Compile_AcousticModel.sh"); print "$command\n" if $debug; system($command) == 0 or die "system $command failed: $?";     
    144         $command = ("chmod o=rwx $HTKdir/fix_master_prompts.pl"); print "$command\n" if $debug; system($command) == 0 or die "system $command failed: $?";     
    145         $command = ("chmod o=rwx $Audio_scriptsdir/Repository.pm"); print "$command\n" if $debug; system($command) == 0 or die "system $command failed: $?";   
    146         $command = ("chmod o=rwx $Audio_scriptsdir/UserSubmission.pm"); print "$command\n" if $debug; system($command) == 0 or die "system $command failed: $?";   
    147         return 1; 
    148 
     78 
    14979 
    15080sub AcousticModelCreation { 
     
    15282        $Nightly_dirname = "AcousticModel-$year-$mon-$mday"; 
    15383        $Nightly_dir = ("/data/svn-mirror/Nightly_Builds"); 
     84        my $promptsfile = $parms{"PromptsFile"}; 
    15485        # run Acoustic Model Creation Script for 16kHz-16bit 
    15586        $rate = "16kHz_16bit"; # !!!!!! need to change all directories with underscore (i.e. 16kHz_16bit) to use a dash (i.e. 16kHz-16bit) - too confusing 
    15687                print "\n***creating $rate Acoustic Model\n"; 
    157                 $command = ("cd $HTKdir && perl ./fix_master_prompts.pl $rate"); print "$command\n" if $debug;system($command) == 0 or die "system $command failed: $?";       
     88                $command = ("cd $HTKdir && perl ./fix_master_prompts.pl $rate $promptsfile"); print "$command\n" if $debug;system($command) == 0 or die "system $command failed: $?";          
    15889                $command = ("cd $HTKdir && \./Compile_AcousticModel.sh $HTKbin $debug"); print "$command\n" if $debug;  system($command) == 0 or die "system $command failed: $?";       
    15990                $Nightly_subdir =("HTK/$rate/MFCC_O_D");