Loading ...
Sorry, an error occurred while loading the content.

[marf-dev] [Help] MARF always returns the same ID

Expand Messages
  • SourceForge.net
    The following forum message was posted by at http://sourceforge.net/projects/marf/forums/forum/213052/topic/5131484: Code: [code]import static marf.MARF.*;
    Message 1 of 1 , Mar 21, 2012
    • 0 Attachment
      The following forum message was posted by at http://sourceforge.net/projects/marf/forums/forum/213052/topic/5131484:

      Code:

      [code]import static marf.MARF.*;

      public class AudioRecognizer {

      final static String TRAINING_HELLO = "training_hello_8K_16Bit.wav";
      final static String TESTING_HELLO = "testing_hello_8K_16Bit.wav";
      final static String TESTING_BYE = "testing_by_8K_16Bit.wav";

      public static void main(String[] args) throws Exception {

      setSampleFile(TRAINING_HELLO);
      setSampleFormat(WAV);
      setPreprocessingMethod(RAW);
      setFeatureExtractionMethod(FFT);
      setClassificationMethod(EUCLIDEAN_DISTANCE);
      int currentSubject = 1234;
      setCurrentSubject(currentSubject);
      train();

      setSampleFile(TESTING_HELLO);
      recognize();
      double outcome = getResult().getOutcome();
      System.out.println("testing_hello outcome: " + outcome);

      int resultID = queryResultID();
      System.out.println("Are the two audio same?");
      System.out.println(currentSubject == resultID);

      setSampleFile(TESTING_BYE);
      recognize();
      outcome = getResult().getOutcome();
      System.out.println("testing_bye outcome: " + outcome);

      resultID = queryResultID();
      System.out.println("Are the two audio same?");
      System.out.println(currentSubject == resultID);

      }

      }[/code]

      Output:

      [code]StorageManager.restore() --- file not found:
      "marf.Storage.TrainingSet.0.0.107.301.512.gzbin",
      marf.Storage.TrainingSet.0.0.107.301.512.gzbin (No such file or directory)
      Creating one now...
      testing_hello outcome: 1.1992869338362822
      Are the two audio same?
      true
      testing_hello outcome: 11.106793776233202
      Are the two audio same?
      true[/code]

      ------------------------------------------------------------------------------
      For Developers, A Lot Can Happen In A Second.
      Boundary is the first to Know...and Tell You.
      Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
      http://p.sf.net/sfu/Boundary-d2dvs2
      _______________________________________________
      marf-devel mailing list
      marf-devel@...
      https://lists.sourceforge.net/lists/listinfo/marf-devel
    Your message has been successfully submitted and would be delivered to recipients shortly.