Class DelphinIDUtils
java.lang.Object
rawDeepLearningClassifier.dlClassification.delphinID.DelphinIDUtils
A bunch of utility functions that a re useful for testing and running
DelphinID models
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ArrayList<AbstractWhistleDataUnit>
getWhistleContoursMAT
(String filePath) Load whistle contours from a MAT file.static ArrayList<AbstractWhistleDataUnit>
getWhistleContoursMAT
(us.hebi.matlab.mat.types.Struct whistlesStruct, double fftLen, double fftHop, double sampleRate) Load whistle contours from a MATLAB structstatic void
prepDelphinIDModel
(String modelPath) static ArrayList<SegmenterDetectionGroup>
segmentWhsitleData
(ArrayList<AbstractWhistleDataUnit> whistles, long dataStartMillis, double segLen, double segHop) Segment the detections into groups.
-
Constructor Details
-
DelphinIDUtils
public DelphinIDUtils()
-
-
Method Details
-
prepDelphinIDModel
-
getWhistleContoursMAT
Load whistle contours from a MAT file. ()- Parameters:
filePath
- - the file path.- Returns:
- a list of whistle contour objects from the mat file.
-
getWhistleContoursMAT
public static ArrayList<AbstractWhistleDataUnit> getWhistleContoursMAT(us.hebi.matlab.mat.types.Struct whistlesStruct, double fftLen, double fftHop, double sampleRate) Load whistle contours from a MATLAB struct- Parameters:
whistlesStruct
- - a struct containing a list of whistle contoursfftLen
- - the fft length in samplesfftHop
- - the fft hop in samples.sampleRate
- - the sample rate in samples per second.- Returns:
- a list of whistle contour objects from the struct.
-
segmentWhsitleData
public static ArrayList<SegmenterDetectionGroup> segmentWhsitleData(ArrayList<AbstractWhistleDataUnit> whistles, long dataStartMillis, double segLen, double segHop) Segment the detections into groups. Note that segments are overlaps so each whistle may belong to multiple segments.- Parameters:
whistles
- - a list of whistles - not necessarily sorted by time.dataStartMillis
- - the start time of the data in millis i.e. where the first segment starts.segLen
- - the segment size in milliseconds.segHop
- - the segment hop in milliseconds.- Returns:
- groups of data units within each segment.
-
main
-