Warning: session_start(): open(/var/lib/php/sessions/sess_e7jrjt3370d41fo4pmjonad5o1, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
scope trainVAD.
sclass TrainVAD {
replace Recognizer with F1.
new Best best;
LPair trainingList;
*() {
final BWImage img1 = frequencyImage(voiceMegaMix());
final BWImage img2 = frequencyImage(nonVoiceMegaMix());
int clipLength = iround(2.0*spectro_pixelsPerSecond());
int stepSize = clipLength/4;
print(+clipLength);
L images1 = map(func(IntRange r) -> BWImage { bwHorizontalClip(img1, r) }, stepIntRange(clipLength, intRange(0, img1.getWidth()), stepSize));
L images2 = map(func(IntRange r) -> BWImage { bwHorizontalClip(img2, r) }, stepIntRange(clipLength, intRange(0, img2.getWidth()), stepSize));
print(allImageSizes(concatLists(images1, images2)));
print(l(images1) + " + " + l(images2) + " images");
trainingList = trueFalseBPairs(images1, images2);
// dummy recognizers first
test(func(BWImage img) -> bool { false });
test(func(BWImage img) -> bool { true });
// now an actual one
test(Rec1());
}
void test(Recognizer r) {
scorePreciseRecognizer(best, r, trainingList);
}
}
sclass #Rec1 extends F1 {
public Bool get(BWImage img) {
ret hasStreaksLongerThan(5, audio_streaksUsingBand_v1(img,
audio_bestBandForEntryPoints()));
}
}
static F1 trainVAD() {
ret TrainVAD().best!;
}
end scope