Class DelphinIDWhistleTest

java.lang.Object
rawDeepLearningClassifier.dlClassification.delphinID.DelphinIDWhistleTest

public class DelphinIDWhistleTest extends Object
A delphinID test suite.
Author:
Jamie Macaulay
  • Constructor Details Link icon

    • DelphinIDWhistleTest Link icon

      public DelphinIDWhistleTest()
  • Method Details Link icon

    • main Link icon

      public static void main(String[] args)
      Main class for running the test.
      Parameters:
      args - - the arguments
    • runWhistleModel Link icon

      public static float[][] runWhistleModel(String modelPath, String whistleContourPath, String matImageSave, double startSeconds, double segLen, double segHop)
      Run delphinID on a single binary file. This calls the delphinID model, sets up the data transforms based on the JSON metadata and then runs the model on segments of the binary file data
      Parameters:
      modelPath - - the path to the delphinID model.
      whistleContourPath - - path to the whistle .mat file. This is a MATLAb struct of data from a binary file.
      matImageSave - - optional path to save data on transforms to MATLAB
      startSeconds - - where to start segmentation within the file in seconds.
      segLen - - the segment length in samples
      segHop - - the segment hop in samples
      Returns:
      true if everything worked without throwing an error.
    • whistleScatter2Image Link icon

      public static double[][] whistleScatter2Image(double[][] whistleValues, double startseg, double seglen)
    • testDelphin2DImage Link icon

      public static boolean testDelphin2DImage(String imagePathOut)
      This test runs delphinID on a single 4 second window from whistle contours saved in a mat file. The mat file also contains an image from Python. The test compares the Python image to to the image generated by exporting both images to a .mat file. The model is run on both images and results are compared
      Returns:
    • testDelphinIDArray Link icon

      public static boolean testDelphinIDArray(String matFileout)
      This test runs delphinID on one 4 second window from whistle contours saved in a mat file.
      Returns:
      true if the test is passed.
    • matrix2array1D Link icon

      public static double[] matrix2array1D(us.hebi.matlab.mat.types.Matrix matrix)
      Convert a matrix to a
      Parameters:
      matrix - - the MAT file matrix
      Returns:
      double[][] array of results