Skip to content

Commit

Permalink
General bug fixes for recognizers
Browse files Browse the repository at this point in the history
Reorganized config recognizers to simplify layout and prevent confusing errors.

Also discovered event files were not being serialized properly. Fixed with a cast.
  • Loading branch information
atruskie committed Mar 15, 2018
1 parent 5d6368f commit 668d06b
Show file tree
Hide file tree
Showing 32 changed files with 58 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ DisplayCsvImage: false
## End section for AnalyzeLongRecording

# Other config files to reference
IndexPropertiesConfig: "./IndexPropertiesConfigHiRes.yml"
HighResolutionIndicesConfig: "./Towsey.AcousticHiResIndicesForRecognisers.yml"

HighResolutionIndicesConfig: "../Towsey.Acoustic.HiResIndicesForRecognisers.yml"
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ DisplayCsvImage: false
## End section for AnalyzeLongRecording

# Other config files to reference
IndexPropertiesConfig: "./IndexPropertiesConfigHiRes.yml"
HighResolutionIndicesConfig: "./Towsey.AcousticHiResIndicesForRecognisers.yml"

HighResolutionIndicesConfig: "../Towsey.Acoustic.HiResIndicesForRecognisers.yml"
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,6 @@ DisplayCsvImage: false
## End section for AnalyzeLongRecording

# Other config files to reference
IndexPropertiesConfig: "./IndexPropertiesConfigHiRes.yml"
HighResolutionIndicesConfig: "./Towsey.AcousticHiResIndicesForRecognisers.yml"

HighResolutionIndicesConfig: "../Towsey.Acoustic.HiResIndicesForRecognisers.yml"
...
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,6 @@ DisplayCsvImage: false
## End section for AnalyzeLongRecording

# Other config files to reference
IndexPropertiesConfig: "./IndexPropertiesConfigHiRes.yml"
HighResolutionIndicesConfig: "./Towsey.AcousticHiResIndicesForRecognisers.yml"

HighResolutionIndicesConfig: "../Towsey.Acoustic.HiResIndicesForRecognisers.yml"
...
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ DisplayCsvImage: false
## End section for AnalyzeLongRecording

# Other config files to reference
IndexPropertiesConfig: "./IndexPropertiesConfigHiRes.yml"
HighResolutionIndicesConfig: "./Towsey.AcousticHiResIndicesForRecognisers.yml"

HighResolutionIndicesConfig: "../Towsey.Acoustic.HiResIndicesForRecognisers.yml"
...
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ DisplayCsvImage: false
## End section for AnalyzeLongRecording

# Other config files to reference
IndexPropertiesConfig: "./IndexPropertiesConfigHiRes.yml"
HighResolutionIndicesConfig: "./Towsey.AcousticHiResIndicesForRecognisers.yml"

HighResolutionIndicesConfig: "../Towsey.Acoustic.HiResIndicesForRecognisers.yml"
...
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ DisplayCsvImage: false
## End section for AnalyzeLongRecording

# Other config files to reference
IndexPropertiesConfig: "./IndexPropertiesConfigHiRes.yml"
HighResolutionIndicesConfig: "./Towsey.AcousticHiResIndicesForRecognisers.yml"

HighResolutionIndicesConfig: "../Towsey.Acoustic.HiResIndicesForRecognisers.yml"
...
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ DisplayCsvImage: false
## End section for AnalyzeLongRecording

# Other config files to reference
IndexPropertiesConfig: "./IndexPropertiesConfigHiRes.yml"
HighResolutionIndicesConfig: "./Towsey.AcousticHiResIndicesForRecognisers.yml"

HighResolutionIndicesConfig: "../Towsey.Acoustic.HiResIndicesForRecognisers.yml"
...
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ DisplayCsvImage: false
## End section for AnalyzeLongRecording

# Other config files to reference
IndexPropertiesConfig: "./IndexPropertiesConfigHiRes.yml"
HighResolutionIndicesConfig: "./Towsey.AcousticHiResIndicesForRecognisers.yml"

HighResolutionIndicesConfig: "../Towsey.Acoustic.HiResIndicesForRecognisers.yml"
...
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ DisplayCsvImage: false


# Other config files to reference
IndexPropertiesConfig: "./IndexPropertiesConfigHiRes.yml"
HighResolutionIndicesConfig: "./Towsey.AcousticHiResIndicesForRecognisers.yml"

HighResolutionIndicesConfig: "../Towsey.Acoustic.HiResIndicesForRecognisers.yml"
...
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,5 @@ SaveSonogramImages: Never
# DisplayCsvImage is obsolete - ensure it remains set to: false
DisplayCsvImage: false

IndexPropertiesConfig: ".\\IndexPropertiesConfigHiRes.yml"
HighResolutionIndicesConfig: "./Towsey.AcousticHiResIndicesForRecognisers.yml"
HighResolutionIndicesConfig: "../Towsey.Acoustic.HiResIndicesForRecognisers.yml"
...
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ DisplayCsvImage: false
## End section for AnalyzeLongRecording

# Other config files to reference
IndexPropertiesConfig: "./IndexPropertiesConfigHiRes.yml"
HighResolutionIndicesConfig: "./Towsey.AcousticHiResIndicesForRecognisers.yml"

HighResolutionIndicesConfig: "../Towsey.Acoustic.HiResIndicesForRecognisers.yml"
...
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ DisplayCsvImage: false
## End section for AnalyzeLongRecording

# Other config files to reference
IndexPropertiesConfig: "./IndexPropertiesConfigHiRes.yml"
HighResolutionIndicesConfig: "./Towsey.AcousticHiResIndicesForRecognisers.yml"

HighResolutionIndicesConfig: "../Towsey.Acoustic.HiResIndicesForRecognisers.yml"
...
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,6 @@ DisplayCsvImage: false
## End section for AnalyzeLongRecording

# Other config files to reference
IndexPropertiesConfig: "./IndexPropertiesConfigHiRes.yml"
HighResolutionIndicesConfig: "./Towsey.AcousticHiResIndicesForRecognisers.yml"

HighResolutionIndicesConfig: "../Towsey.Acoustic.HiResIndicesForRecognisers.yml"
...
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ DisplayCsvImage: false
## End section for AnalyzeLongRecording

# Other config files to reference
IndexPropertiesConfig: "./IndexPropertiesConfigHiRes.yml"
HighResolutionIndicesConfig: "./Towsey.AcousticHiResIndicesForRecognisers.yml"

HighResolutionIndicesConfig: "../Towsey.Acoustic.HiResIndicesForRecognisers.yml"
...
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ DisplayCsvImage: false
## End section for AnalyzeLongRecording

# Other config files to reference
IndexPropertiesConfig: "./IndexPropertiesConfigHiRes.yml"
HighResolutionIndicesConfig: "./Towsey.AcousticHiResIndicesForRecognisers.yml"

HighResolutionIndicesConfig: "../Towsey.Acoustic.HiResIndicesForRecognisers.yml"
...
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ DisplayCsvImage: false
## End section for AnalyzeLongRecording

# Other config files to reference
IndexPropertiesConfig: "./IndexPropertiesConfigHiRes.yml"
HighResolutionIndicesConfig: "./Towsey.AcousticHiResIndicesForRecognisers.yml"

HighResolutionIndicesConfig: "../Towsey.Acoustic.HiResIndicesForRecognisers.yml"
...
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ DisplayCsvImage: false
## End section for AnalyzeLongRecording

# Other config files to reference
IndexPropertiesConfig: "./IndexPropertiesConfigHiRes.yml"
HighResolutionIndicesConfig: "./Towsey.AcousticHiResIndicesForRecognisers.yml"

HighResolutionIndicesConfig: "../Towsey.Acoustic.HiResIndicesForRecognisers.yml"
...
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ DisplayCsvImage: false
## End section for AnalyzeLongRecording

# Other config files to reference
IndexPropertiesConfig: "./IndexPropertiesConfigHiRes.yml"
HighResolutionIndicesConfig: "./Towsey.AcousticHiResIndicesForRecognisers.yml"

HighResolutionIndicesConfig: "../Towsey.Acoustic.HiResIndicesForRecognisers.yml"
...
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ DisplayCsvImage: false
## End section for AnalyzeLongRecording

# Other config files to reference
IndexPropertiesConfig: "./IndexPropertiesConfigHiRes.yml"
HighResolutionIndicesConfig: "./Towsey.AcousticHiResIndicesForRecognisers.yml"

HighResolutionIndicesConfig: "../Towsey.Acoustic.HiResIndicesForRecognisers.yml"
...
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ DisplayCsvImage: false
## End section for AnalyzeLongRecording

# Other config files to reference
IndexPropertiesConfig: "./IndexPropertiesConfigHiRes.yml"
HighResolutionIndicesConfig: "./Towsey.AcousticHiResIndicesForRecognisers.yml"

HighResolutionIndicesConfig: "../Towsey.Acoustic.HiResIndicesForRecognisers.yml"
...
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ DisplayCsvImage: false
## End section for AnalyzeLongRecording

# Other config files to reference
IndexPropertiesConfig: "./IndexPropertiesConfigHiRes.yml"
HighResolutionIndicesConfig: "./Towsey.AcousticHiResIndicesForRecognisers.yml"

HighResolutionIndicesConfig: "../Towsey.Acoustic.HiResIndicesForRecognisers.yml"
...
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ DisplayCsvImage: false
## End section for AnalyzeLongRecording

# Other config files to reference
IndexPropertiesConfig: "./IndexPropertiesConfigHiRes.yml"
HighResolutionIndicesConfig: "./Towsey.AcousticHiResIndicesForRecognisers.yml"

HighResolutionIndicesConfig: "../Towsey.Acoustic.HiResIndicesForRecognisers.yml"
...
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ SaveSonogramImages: Never
DisplayCsvImage: false

IndexPropertiesConfig: ".\\IndexPropertiesConfigHiRes.yml"
HighResolutionIndicesConfig: "./Towsey.AcousticHiResIndicesForRecognisers.yml"
HighResolutionIndicesConfig: "../Towsey.Acoustic.HiResIndicesForRecognisers.yml"
...
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ DisplayCsvImage: false
## End section for AnalyzeLongRecording

# Other config files to reference
IndexPropertiesConfig: "./IndexPropertiesConfigHiRes.yml"
HighResolutionIndicesConfig: "./Towsey.AcousticHiResIndicesForRecognisers.yml"

HighResolutionIndicesConfig: "../Towsey.Acoustic.HiResIndicesForRecognisers.yml"
...
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ SaveSonogramImages: Never
DisplayCsvImage: false

IndexPropertiesConfig: ".\\IndexPropertiesConfigHiRes.yml"
HighResolutionIndicesConfig: "./Towsey.AcousticHiResIndicesForRecognisers.yml"
HighResolutionIndicesConfig: "../Towsey.Acoustic.HiResIndicesForRecognisers.yml"
...
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ DisplayCsvImage: false
## End section for AnalyzeLongRecording

# Other config files to reference
IndexPropertiesConfig: "./IndexPropertiesConfigHiRes.yml"
HighResolutionIndicesConfig: "./Towsey.AcousticHiResIndicesForRecognisers.yml"

HighResolutionIndicesConfig: "../Towsey.Acoustic.HiResIndicesForRecognisers.yml"
...
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@ DisplayCsvImage: false
## End section for AnalyzeLongRecording

# Other config files to reference
IndexPropertiesConfig: "./IndexPropertiesConfigHiRes.yml"
HighResolutionIndicesConfig: "./Towsey.AcousticHiResIndicesForRecognisers.yml"

HighResolutionIndicesConfig: "../Towsey.Acoustic.HiResIndicesForRecognisers.yml"
...
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ LowResColourMap1: ACI-ENT-EVN
LowResColourMap2: BGN-POW-EVN


IndexPropertiesConfig: './IndexPropertiesConfigHiRes.yml'
IndexPropertiesConfig: './IndexPropertiesConfig.HiRes.yml'
SpectrogramConfig: './SpectrogramConfigHiRes.yml'
...

2 changes: 1 addition & 1 deletion src/AnalysisPrograms/Recognizers/Base/RecognizerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ private void SummarizeHighResolutionIndices(

public override void WriteEventsFile(FileInfo destination, IEnumerable<EventBase> results)
{
Csv.WriteToCsv(destination, results);
Csv.WriteToCsv(destination, results.Select(x => (AcousticEvent)x));
}

public override void WriteSummaryIndicesFile(FileInfo destination, IEnumerable<SummaryIndexBase> results)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ namespace AudioAnalysisTools.LongDurationSpectrograms
using System.Collections.Generic;
using System.IO;
using Acoustics.Shared;
using Acoustics.Shared.ConfigFile;
using Newtonsoft.Json;
using YamlDotNet.Serialization;

/// <summary>
/// CONFIG CLASS FOR the class LDSpectrogramRGB
/// </summary>
public class LdSpectrogramConfig
public class LdSpectrogramConfig : Config
{
/// <summary>
/// Initializes a new instance of the <see cref="LdSpectrogramConfig"/> class.
Expand Down Expand Up @@ -105,7 +106,7 @@ public double CalculateYAxisTickInterval(double sampleRate, double frameWidth)
/// </returns>
public static LdSpectrogramConfig ReadYamlToConfig(FileInfo path)
{
var config = Yaml.Deserialize<LdSpectrogramConfig>(path);
var config = ConfigFile.Deserialize<LdSpectrogramConfig>(path);
return config;
}

Expand Down

0 comments on commit 668d06b

Please sign in to comment.