Class DelphinIDWhistleTest
java.lang.Object
rawDeepLearningClassifier.dlClassification.delphinID.DelphinIDWhistleTest
A delphinID test suite.
- Author:
 - Jamie Macaulay
 
- 
Nested Class Summary
Nested Classes - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionstatic voidMain class for running the test.static double[]matrix2array1D(us.hebi.matlab.mat.types.Matrix matrix) Convert a matrix to astatic float[][]runWhistleModel(String modelPath, String whistleContourPath, String matImageSave, double startSeconds, double segLen, double segHop) Run delphinID on a single binary file.static booleantestDelphin2DImage(String imagePathOut) This test runs delphinID on a single 4 second window from whistle contours saved in a mat file.static booleantestDelphinIDArray(String matFileout) This test runs delphinID on one 4 second window from whistle contours saved in a mat file.static double[][]whistleScatter2Image(double[][] whistleValues, double startseg, double seglen)  
- 
Constructor Details
- 
DelphinIDWhistleTest
public DelphinIDWhistleTest() 
 - 
 - 
Method Details
- 
main
Main class for running the test.- Parameters:
 args- - the arguments
 - 
runWhistleModel
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 MATLABstartSeconds- - where to start segmentation within the file in seconds.segLen- - the segment length in samplessegHop- - the segment hop in samples- Returns:
 - true if everything worked without throwing an error.
 
 - 
whistleScatter2Image
public static double[][] whistleScatter2Image(double[][] whistleValues, double startseg, double seglen)  - 
testDelphin2DImage
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
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
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
 
 
 -