Scaffold C# wakeword probe: vendored ONNX models + ORT sanity spike

Models sourced from openwakeword==0.6.0 on the Pi (alexa_v0.1.onnx
vendored as alexa.onnx). ORT 1.26.0 loads all three on linux-arm64
self-contained publish; libonnxruntime.so confirmed in publish dir.

SHA-256:
  melspectrogram.onnx  ba2b0e0f8b7b875369a2c89cb13360ff53bac436f2895cced9f479fa65eb176f
  embedding_model.onnx 70d164290c1d095d1d4ee149bc5e00543250a7316b59f31d056cff7bd3075c1f
  alexa.onnx           6ff566a01d12670e8d9e3c59da32651db1575d17272a601b7f8a39283dfbae3e
This commit is contained in:
2026-06-12 11:24:46 +00:00
parent fe15a009b3
commit 849ad47230
5 changed files with 53 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>WakewordProbe</RootNamespace>
<AssemblyName>Probe</AssemblyName>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RuntimeIdentifier>linux-arm64</RuntimeIdentifier>
<SelfContained>true</SelfContained>
<PublishSingleFile>false</PublishSingleFile>
<InvariantGlobalization>true</InvariantGlobalization>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="PortAudioSharp2" Version="1.0.6" />
<PackageReference Include="Microsoft.ML.OnnxRuntime" Version="1.26.0" />
</ItemGroup>
<ItemGroup>
<Content Include="models/*.onnx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
</Project>
+29
View File
@@ -0,0 +1,29 @@
using Microsoft.ML.OnnxRuntime;
string modelsDir = Path.Combine(AppContext.BaseDirectory, "models");
string[] modelFiles = { "melspectrogram.onnx", "embedding_model.onnx", "alexa.onnx" };
var opts = new SessionOptions
{
IntraOpNumThreads = 1,
InterOpNumThreads = 1,
LogSeverityLevel = OrtLoggingLevel.ORT_LOGGING_LEVEL_ERROR,
};
foreach (var f in modelFiles)
{
string path = Path.Combine(modelsDir, f);
Console.WriteLine($"== {f} ==");
using var session = new InferenceSession(path, opts);
foreach (var kv in session.InputMetadata)
{
var dims = string.Join(",", kv.Value.Dimensions);
Console.WriteLine($" input '{kv.Key}': shape=[{dims}] dtype={kv.Value.ElementType.Name}");
}
foreach (var kv in session.OutputMetadata)
{
var dims = string.Join(",", kv.Value.Dimensions);
Console.WriteLine($" output '{kv.Key}': shape=[{dims}] dtype={kv.Value.ElementType.Name}");
}
}
Console.WriteLine("All three models loaded.");
Binary file not shown.
Binary file not shown.
Binary file not shown.