Conversation
Co-authored-by: tqmane <149690876+tqmane@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix functionality for ai_image_test benchmarking app
Fix pixel normalization in inference engines; improve DirectML FFI bindings
Feb 18, 2026
tqmane
added a commit
that referenced
this pull request
Feb 18, 2026
…lity Fix pixel normalization in inference engines; improve DirectML FFI bindings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Face recognition models (MobileFaceNet etc.) expect pixel input in
[-1, 1], but all three engines were normalizing to[0, 1]— causing inference scores to saturate and making threshold changes have no observable effect.Normalization fix (
tflite_engine.dart,onnx_engine.dart,onnx_directml_engine.dart)Applied to both NHWC (TFLite) and NCHW (ONNX) preprocessing paths.
DirectML FFI (
onnx_directml_ffi.dart)onnxruntime-directml.dllover the standard DLL; falls back gracefully when absentOrtSessionOptions_AppendExecutionProvider_DMLat runtime; exposesisDirectMLFunctionAvailableandappendExecutionProviderDML()DirectML engine (
onnx_directml_engine.dart)Documents the blocker:
onnxruntimev1.4.x does not expose theOrtSessionOptions*raw pointer, so the DirectML provider cannot be injected via the high-level Dart API even when the DLL is present. XNNPACK is retained as the best available fallback; DLL detection result is logged.pubspec.yamlAdded a comment: true DirectML GPU support requires
onnxruntime-directml.dll(fromMicrosoft.ML.OnnxRuntime.DirectMLNuGet) placed beside the executable. No separateonnxruntime_directmlpub.dev package exists as of v1.4.1.✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.