dotnet / machinelearning

ML.NET is an open source and cross-platform machine learning framework for .NET.
https://dot.net/ml
MIT License
9.05k stars 1.88k forks source link

Load onnx model from Stream of bytes #7254

Closed michaelgsharp closed 1 month ago

michaelgsharp commented 1 month ago

Fixes #6591 by adding an overload API to allow the ONNX model to be passed in as a Stream of bytes.

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 64.22764% with 44 lines in your changes missing coverage. Please review.

Project coverage is 68.78%. Comparing base (be1e428) to head (9f5e86c). Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
src/Microsoft.ML.OnnxTransformer/OnnxCatalog.cs 13.79% 25 Missing :warning:
src/Microsoft.ML.OnnxTransformer/OnnxTransform.cs 61.36% 16 Missing and 1 partial :warning:
...osoft.ML.OnnxTransformerTest/OnnxTransformTests.cs 95.00% 0 Missing and 2 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #7254 +/- ## ========================================== + Coverage 68.77% 68.78% +0.01% ========================================== Files 1462 1463 +1 Lines 272261 272407 +146 Branches 28176 28183 +7 ========================================== + Hits 187254 187386 +132 - Misses 77764 77778 +14 Partials 7243 7243 ``` | [Flag](https://app.codecov.io/gh/dotnet/machinelearning/pull/7254/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dotnet) | Coverage Δ | | |---|---|---| | [Debug](https://app.codecov.io/gh/dotnet/machinelearning/pull/7254/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dotnet) | `68.78% <64.22%> (+0.01%)` | :arrow_up: | | [production](https://app.codecov.io/gh/dotnet/machinelearning/pull/7254/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dotnet) | `63.29% <49.39%> (+<0.01%)` | :arrow_up: | | [test](https://app.codecov.io/gh/dotnet/machinelearning/pull/7254/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dotnet) | `89.05% <95.00%> (+<0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dotnet#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files with missing lines](https://app.codecov.io/gh/dotnet/machinelearning/pull/7254?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dotnet) | Coverage Δ | | |---|---|---| | [src/Microsoft.ML.OnnxTransformer/OnnxUtils.cs](https://app.codecov.io/gh/dotnet/machinelearning/pull/7254?src=pr&el=tree&filepath=src%2FMicrosoft.ML.OnnxTransformer%2FOnnxUtils.cs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dotnet#diff-c3JjL01pY3Jvc29mdC5NTC5Pbm54VHJhbnNmb3JtZXIvT25ueFV0aWxzLmNz) | `84.82% <100.00%> (+0.61%)` | :arrow_up: | | [...osoft.ML.OnnxTransformerTest/OnnxTransformTests.cs](https://app.codecov.io/gh/dotnet/machinelearning/pull/7254?src=pr&el=tree&filepath=test%2FMicrosoft.ML.OnnxTransformerTest%2FOnnxTransformTests.cs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dotnet#diff-dGVzdC9NaWNyb3NvZnQuTUwuT25ueFRyYW5zZm9ybWVyVGVzdC9Pbm54VHJhbnNmb3JtVGVzdHMuY3M=) | `95.54% <95.00%> (-0.04%)` | :arrow_down: | | [src/Microsoft.ML.OnnxTransformer/OnnxTransform.cs](https://app.codecov.io/gh/dotnet/machinelearning/pull/7254?src=pr&el=tree&filepath=src%2FMicrosoft.ML.OnnxTransformer%2FOnnxTransform.cs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dotnet#diff-c3JjL01pY3Jvc29mdC5NTC5Pbm54VHJhbnNmb3JtZXIvT25ueFRyYW5zZm9ybS5jcw==) | `87.35% <61.36%> (-2.48%)` | :arrow_down: | | [src/Microsoft.ML.OnnxTransformer/OnnxCatalog.cs](https://app.codecov.io/gh/dotnet/machinelearning/pull/7254?src=pr&el=tree&filepath=src%2FMicrosoft.ML.OnnxTransformer%2FOnnxCatalog.cs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dotnet#diff-c3JjL01pY3Jvc29mdC5NTC5Pbm54VHJhbnNmb3JtZXIvT25ueENhdGFsb2cuY3M=) | `58.90% <13.79%> (-29.74%)` | :arrow_down: | ... and [9 files with indirect coverage changes](https://app.codecov.io/gh/dotnet/machinelearning/pull/7254/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dotnet)