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:
@@ -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.");
|
||||
Reference in New Issue
Block a user