Skip to content

Commit

Permalink
commit demo
Browse files Browse the repository at this point in the history
Commit demo code for Alize Speaker Recognition Project.
  • Loading branch information
ibillxia committed Mar 12, 2013
1 parent 08a9a46 commit 6ea9059
Show file tree
Hide file tree
Showing 66 changed files with 13,097 additions and 0 deletions.
Binary file added Demo/AlizeBin2.0/BNGram.exe
Binary file not shown.
Binary file added Demo/AlizeBin2.0/ComputeJFAStats.exe
Binary file not shown.
Binary file added Demo/AlizeBin2.0/ComputeNorm.exe
Binary file not shown.
Binary file added Demo/AlizeBin2.0/ComputeTest.exe
Binary file not shown.
Binary file added Demo/AlizeBin2.0/CovIntra.exe
Binary file not shown.
Binary file added Demo/AlizeBin2.0/EigenChannel.exe
Binary file not shown.
Binary file added Demo/AlizeBin2.0/EigenVoice.exe
Binary file not shown.
Binary file added Demo/AlizeBin2.0/EnergyDetector.exe
Binary file not shown.
Binary file added Demo/AlizeBin2.0/EstimateDMatrix.exe
Binary file not shown.
Binary file added Demo/AlizeBin2.0/ExtractParams.exe
Binary file not shown.
Binary file added Demo/AlizeBin2.0/FusionScore.exe
Binary file not shown.
Binary file added Demo/AlizeBin2.0/GmmTokenizer.exe
Binary file not shown.
Binary file added Demo/AlizeBin2.0/Hist.exe
Binary file not shown.
Binary file added Demo/AlizeBin2.0/LabelFusion.exe
Binary file not shown.
Binary file added Demo/AlizeBin2.0/LabelNGram.exe
Binary file not shown.
Binary file added Demo/AlizeBin2.0/ModelToSv.exe
Binary file not shown.
Binary file added Demo/AlizeBin2.0/NAPSV.exe
Binary file not shown.
Binary file added Demo/AlizeBin2.0/NormFeat.exe
Binary file not shown.
Binary file added Demo/AlizeBin2.0/NormFeatWindowMode.exe
Binary file not shown.
Binary file added Demo/AlizeBin2.0/PolyExpand.exe
Binary file not shown.
Binary file added Demo/AlizeBin2.0/ReadFeatFile.exe
Binary file not shown.
Binary file added Demo/AlizeBin2.0/ReadModel.exe
Binary file not shown.
Binary file added Demo/AlizeBin2.0/ScoreWarp.exe
Binary file not shown.
Binary file added Demo/AlizeBin2.0/Scoring.exe
Binary file not shown.
Binary file added Demo/AlizeBin2.0/SequenceDecoder.exe
Binary file not shown.
Binary file added Demo/AlizeBin2.0/SequenceExtractor.exe
Binary file not shown.
Binary file added Demo/AlizeBin2.0/SpkAdapt.exe
Binary file not shown.
Binary file added Demo/AlizeBin2.0/Svm.exe
Binary file not shown.
Binary file added Demo/AlizeBin2.0/TimeCluster.exe
Binary file not shown.
Binary file added Demo/AlizeBin2.0/TrainTarget.exe
Binary file not shown.
Binary file added Demo/AlizeBin2.0/TrainWorld.exe
Binary file not shown.
113 changes: 113 additions & 0 deletions Demo/FeatureExtraction.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
package Demo;
use strict;
use warnings;

require Exporter;
our @ISA = qw(Exporter);
our @EXPORT_OK = qw(ExactFeature EnergyDetect NormalizateFeature NormalizateFeatureForEnergy );


sub ExactFeature
{
my ($energydetectorlist, $spherepath, $featurepath, $labelpath) = @_;

ExactFeatureFromList($energydetectorlist, $spherepath, $featurepath);
NormalizateFeatureForEnergy($energydetectorlist, $featurepath);
EnergyDetect($energydetectorlist, $featurepath, $labelpath);
NormalizateFeature($energydetectorlist,$featurepath, $labelpath);
}


sub ExactFeatureFromList
{
my ($utterlistfilename, $sphfilepath, $featurepath) = @_;

open(TFH, "<$utterlistfilename");

while (<TFH>)
{
chomp;
my @tmpelements = split /\\/;
my $utterchannel = $tmpelements[$#tmpelements];
my $uttername;
my $channelname;
my $channelid = 0;
my $channelindex = index($utterchannel, "_");
if ( $channelindex > 0 )
{
$uttername = substr($utterchannel, 0, $channelindex);
$channelname = substr($utterchannel, $channelindex + 1, $channelindex + 2);
if(lc($channelname) eq "a"){ $channelid = 1; }
if(lc($channelname) eq "b"){ $channelid = 2; }
}
else
{
$uttername = $utterchannel;
$channelid = 1;
}

my $sourcefilename = "$sphfilepath$uttername.pcm";
my $targetfilename = "$featurepath$_.pro4";

ExercuteExactFeatureCmd($channelid, $sourcefilename, $targetfilename);

}
close(TFH);
}


sub ExercuteExactFeatureCmd
{
my ($channelid, $sourcefilename, $targetfilename) = @_;

my $cmdstr = "SproBin4.0\\sfbcep -F sphere -m -p 13 -n 24 -k 0.97 -e -D -i 300 -u 3400 -x $channelid $sourcefilename $targetfilename";#-Z -R # MFCC Feature
#my $cmdstr = "SproBin4.0\\slpcep -F sphere -l 30 -n 18 -p 13 -e -D -x $channelid $sourcefilename $targetfilename";#-Z -R

print $cmdstr, "\n";
system($cmdstr);

}


sub NormalizateFeatureForEnergy
{
my ($inputfeaturefilename, $featurepath) = @_;

my $normcmd = "AlizeBin2.0\\NormFeat --config conf\\NormFeatEnergy.cfg ";
$normcmd .= " --inputFeatureFilename $inputfeaturefilename";
$normcmd .= " --featureFilesPath $featurepath";

print $normcmd,"\n";
system($normcmd) == 0 or die "Normalizate Feature For Energy Error£¡";
}


sub EnergyDetect
{
my ($inputfeaturefilename, $featurepath, $labelpath) = @_;

my $detectcmd = "AlizeBin2.0\\EnergyDetector --config conf\\EnergyDetector.cfg ";
$detectcmd .= " --featureFilesPath $featurepath";
$detectcmd .= " --labelFilesPath $labelpath";
$detectcmd .= " --inputFeatureFilename $inputfeaturefilename";

print $detectcmd,"\n";
system($detectcmd) == 0 or die "Energy Detect Error£¡";
}


sub NormalizateFeature
{
my ($inputfeaturefilename,$featurefilespath, $labelpath) = @_;

my $normcmd = "AlizeBin2.0\\NormFeat --config conf\\NormFeat.cfg ";
$normcmd .= " --inputFeatureFilename $inputfeaturefilename";
$normcmd .= " --featureFilesPath $featurefilespath";
$normcmd .= " --labelFilesPath $labelpath";

print $normcmd,"\n";
system($normcmd) == 0 or die "Normalization Feature Error£¡";
}


1;
17 changes: 17 additions & 0 deletions Demo/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
##########################################################
# Voice Print Recognition
#
# Author: Bill Xia
# Email: ibillxia@gmail.com
# Blog: http://ibillxia.github.com
##########################################################

The Demo directory is a simple tutorial of how to use this integrated system.

If you have any questions, you can go to
-------------------------------------------------------------------------------------------------
https://groups.google.com/forum/?hl=zh-CN&fromgroups=#!forum/alize---voice-print-recognition
-------------------------------------------------------------------------------------------------
for help. If you are every familiar with Alize, you can also go to the BBS to help others.
Further more, if you are interested in making contributions to the Alize project with me,
please send an email to me(ibillxia@gmail.com).
Binary file added Demo/SproBin4.0/sfbcep.exe
Binary file not shown.
Binary file added Demo/SproBin4.0/slpcep.exe
Binary file not shown.
56 changes: 56 additions & 0 deletions Demo/UBMGMM.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package Demo;
use strict;
use base 'Exporter';
our @EXPORT_OK = qw(TrainUBM TrainTarget ComputeTest );


sub TrainUBM
{
my ($lambda, $inputfeaturefilename, $outputwordfilename) = @_;

my $trainubm = "AlizeBin2.0\\TrainWorld --config conf\\TrainWorld.cfg ";
$trainubm .= " --inputFeatureFilename $inputfeaturefilename ";
$trainubm .= " --nbTrainIt 25";
$trainubm .= " --baggedFrameProbabilityInit 0.5";
$trainubm .= " --baggedFrameProbability 0.5";
$trainubm .= " --outputWorldFilename $outputwordfilename";
$trainubm .= " --fileInit false";
$trainubm .= " --lambda $lambda";

print $trainubm,"\n";
system($trainubm) == 0 or die "TrainUBM Error£¡";
}


sub TrainTarget
{
my ($targetidlist,$worldfilename,$FeatPath,$MixturePath) = @_;

my $traintarget = "AlizeBin2.0\\TrainTarget --config conf\\TrainTarget.cfg ";
$traintarget .= " --targetIdList $targetidlist";
$traintarget .= " --mixtureFilesPath $MixturePath";
$traintarget .= " --featureFilesPath $FeatPath";
$traintarget .= " --inputWorldFilename $worldfilename";

print $traintarget, "\n";
system($traintarget) == 0 or die "TrainTarget Error£¡";
}


sub ComputeTest
{
my ($testndxFilename, $testmodelPath, $testFeaturePath, $testLabelPath, $worldFilename, $resultfile) = @_;

my $testtarget = "AlizeBin2.0\\ComputeTest --config conf\\ComputeTest.cfg ";
$testtarget .= " --ndxFilename $testndxFilename";
$testtarget .= " --mixtureFilesPath $testmodelPath";
$testtarget .= " --featureFilesPath $testFeaturePath";
$testtarget .= " --labelFilesPath $testLabelPath";
$testtarget .= " --inputWorldFilename $worldFilename";
$testtarget .= " --outputFilename $resultfile";

print $testtarget,"\n";
system($testtarget) == 0 or die "ComputeTest Error£¡";
}

1;
16 changes: 16 additions & 0 deletions Demo/calEER/Compute_EER.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
function EER = Compute_EER(P_miss,P_fa)


%Zhenchun Lei 05-07-23

for j = 1 : size(P_miss, 1)
if P_miss(j) >= P_fa(j)
break
end
end

if P_miss(j) == P_fa(j)
EER = P_miss(j);
else
EER = (P_miss(j)+P_fa(j)+P_miss(j-1)+P_fa(j-1))/4;
end
Loading

0 comments on commit 6ea9059

Please sign in to comment.