diff --git a/tests/02-wakeword-cs/WakewordModel.cs b/tests/02-wakeword-cs/WakewordModel.cs index b40293b..4ee4db1 100644 --- a/tests/02-wakeword-cs/WakewordModel.cs +++ b/tests/02-wakeword-cs/WakewordModel.cs @@ -59,8 +59,11 @@ internal sealed class WakewordModel : IDisposable }; _mel = new InferenceSession(melPath, opts); + PrintShapes(Path.GetFileName(melPath), _mel); _emb = new InferenceSession(embeddingPath, opts); + PrintShapes(Path.GetFileName(embeddingPath), _emb); _cls = new InferenceSession(classifierPath, opts); + PrintShapes(Path.GetFileName(classifierPath), _cls); // Discover input names + assert shape geometry. _melInputName = _mel.InputMetadata.Keys.Single(); @@ -70,6 +73,17 @@ internal sealed class WakewordModel : IDisposable AssertClassifierShape(_cls); // [batch, 16, 96], dtype float } + private static void PrintShapes(string filename, InferenceSession sess) + { + Console.Error.WriteLine($"[wakeword-model] {filename}"); + foreach (var kv in sess.InputMetadata) + Console.Error.WriteLine( + $" input '{kv.Key}': shape=[{string.Join(",", kv.Value.Dimensions)}] dtype={kv.Value.ElementType.Name}"); + foreach (var kv in sess.OutputMetadata) + Console.Error.WriteLine( + $" output '{kv.Key}': shape=[{string.Join(",", kv.Value.Dimensions)}] dtype={kv.Value.ElementType.Name}"); + } + private static void AssertEmbeddingShape(InferenceSession sess) { if (!sess.InputMetadata.TryGetValue(EmbeddingInputName, out var meta)) @@ -144,7 +158,7 @@ internal sealed class WakewordModel : IDisposable var melOut = melResults.First().AsTensor(); // shape (1, 1, n_frames, 32) // Apply openwakeword's `x / 10 + 2` transform and append each new frame to _melRing. - // FIXED: actual mel output shape is (1, 1, n_frames, 32) — n_frames is at Dimensions[2], NOT [1]. + // Mel output shape is (1, 1, n_frames, 32). Note n_frames is at Dimensions[2], not [1]. int nFrames = melOut.Dimensions[2]; for (int f = 0; f < nFrames; f++) {