Warning: session_start(): open(/var/lib/php/sessions/sess_7e5krrb3030lll36urnfi7e78r, 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
!7
sclass Analyzer {
static int baseSize = 1024;
S word1, word2;
Rect clip; // in baseSize*baseSize
float threshold;
S analyze(BWImage img) {
ret clipBWImage(img, rescaleRect(clip, baseSize, baseSize, img.getWidth(), img.getHeight())).averageBrightness() >= threshold ? word1 : word2;
}
}
static LPair images = new L;
sS word1 = "yes", word2 = "no";
p-exp {
L files = audioRecordingsWithSingleClip();
for (File f : allRecordings()) {
S word = wordFromAudioFileName(f);
if (!eqicOneOf(word, word1, word2)) continue;
images.add(pair(word, bwAutoContrast(audio_clipFromLastEntryPoint(audioFileToFrequencyImage(f)))));
print(fileName(f));
}
showImage(second(random(images)));
findBestAnalyzer();
}
void findBestAnalyzer {
final new Best best;
final new AIStrategy_RandomWithVariation strategy;
strategy.random = func -> Analyzer { randomAnalyzer() };
strategy.submit = func(final Analyzer a) -> double {
new Scorer scorer;
for (Pair img : images)
scorer.add(eqic(img.a, analyzer.analyze(img.b)));
if (best.put(r, scorer!))
print(scorer + " / " + sfu(a));
ret scorer!;
};
thread { while licensed { strategy.go(); } }