onnxruntime/csharp
dependabot[bot] 4f2d454211
Bump Sixlabors.ImageSharp from 2.1.1 to 2.1.7 in /csharp/sample/Microsoft.ML.OnnxRuntime.FasterRcnnSample (#19806)
Bumps [Sixlabors.ImageSharp](https://github.com/SixLabors/ImageSharp)
from 2.1.1 to 2.1.7.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/SixLabors/ImageSharp/releases">Sixlabors.ImageSharp's
releases</a>.</em></p>
<blockquote>
<h2>v2.1.7</h2>
<h2>What's Changed</h2>
<ul>
<li>[release/2.1] Disallow allocation attempts of unrepresentable sizes
by <a
href="https://github.com/antonfirsov"><code>@​antonfirsov</code></a> in
<a
href="https://redirect.github.com/SixLabors/ImageSharp/pull/2553">SixLabors/ImageSharp#2553</a></li>
<li>[release/2.1] Tiff decoding robustness improvements (<a
href="https://redirect.github.com/SixLabors/ImageSharp/issues/2550">#2550</a>)
by <a
href="https://github.com/antonfirsov"><code>@​antonfirsov</code></a> in
<a
href="https://redirect.github.com/SixLabors/ImageSharp/pull/2554">SixLabors/ImageSharp#2554</a></li>
<li>[release/2.1] PBM decoder robustness improvements and
BufferedReadStream observability by <a
href="https://github.com/antonfirsov"><code>@​antonfirsov</code></a> in
<a
href="https://redirect.github.com/SixLabors/ImageSharp/pull/2555">SixLabors/ImageSharp#2555</a></li>
<li>Backport 2681 by <a
href="https://github.com/JimBobSquarePants"><code>@​JimBobSquarePants</code></a>
in <a
href="https://redirect.github.com/SixLabors/ImageSharp/pull/2688">SixLabors/ImageSharp#2688</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/SixLabors/ImageSharp/compare/v2.1.6...v2.1.7">https://github.com/SixLabors/ImageSharp/compare/v2.1.6...v2.1.7</a></p>
<h2>v2.1.6</h2>
<h2>What's Changed</h2>
<ul>
<li>Backport - Handle EOF in Jpeg bit reader when data is bad to prevent
DOS attack. by <a
href="https://github.com/JimBobSquarePants"><code>@​JimBobSquarePants</code></a>
in <a
href="https://redirect.github.com/SixLabors/ImageSharp/pull/2524">SixLabors/ImageSharp#2524</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/SixLabors/ImageSharp/compare/v2.1.5...v2.1.6">https://github.com/SixLabors/ImageSharp/compare/v2.1.5...v2.1.6</a></p>
<h2>v2.1.5</h2>
<h2>What's Changed</h2>
<ul>
<li>Backport <a
href="https://redirect.github.com/SixLabors/ImageSharp/issues/2501">#2501</a>
by <a
href="https://github.com/JimBobSquarePants"><code>@​JimBobSquarePants</code></a>
in <a
href="https://redirect.github.com/SixLabors/ImageSharp/pull/2509">SixLabors/ImageSharp#2509</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/SixLabors/ImageSharp/compare/v2.1.4...v2.1.5">https://github.com/SixLabors/ImageSharp/compare/v2.1.4...v2.1.5</a></p>
<h2>v2.1.4</h2>
<h2>What's Changed</h2>
<ul>
<li>Backport WebP fix to 2.1 by <a
href="https://github.com/antonfirsov"><code>@​antonfirsov</code></a> in
<a
href="https://redirect.github.com/SixLabors/ImageSharp/pull/2420">SixLabors/ImageSharp#2420</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/SixLabors/ImageSharp/compare/v2.1.3...v2.1.4">https://github.com/SixLabors/ImageSharp/compare/v2.1.3...v2.1.4</a></p>
<h2>v2.1.3</h2>
<h2>What's Changed</h2>
<ul>
<li>V2 Backport: 2133, 2154 by <a
href="https://github.com/JimBobSquarePants"><code>@​JimBobSquarePants</code></a>
in <a
href="https://redirect.github.com/SixLabors/ImageSharp/pull/2157">SixLabors/ImageSharp#2157</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/SixLabors/ImageSharp/compare/v2.1.2...v2.1.3">https://github.com/SixLabors/ImageSharp/compare/v2.1.2...v2.1.3</a></p>
<h2>v2.1.2</h2>
<h2>What's Changed</h2>
<ul>
<li>Backport - Issue 2123 by <a
href="https://github.com/JimBobSquarePants"><code>@​JimBobSquarePants</code></a>
in <a
href="https://redirect.github.com/SixLabors/ImageSharp/pull/2126">SixLabors/ImageSharp#2126</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/SixLabors/ImageSharp/compare/v2.1.1...v2.1.2">https://github.com/SixLabors/ImageSharp/compare/v2.1.1...v2.1.2</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="fa7d712702"><code>fa7d712</code></a>
Merge pull request <a
href="https://redirect.github.com/SixLabors/ImageSharp/issues/2688">#2688</a>
from SixLabors/js/backport-2681</li>
<li><a
href="36b3533cc3"><code>36b3533</code></a>
Use correct property to disable upstream warnings.</li>
<li><a
href="94bb7615a1"><code>94bb761</code></a>
Update ImageSharp.csproj</li>
<li><a
href="3ea2574726"><code>3ea2574</code></a>
Update PngDecoderCore.cs</li>
<li><a
href="e74a55fbfd"><code>e74a55f</code></a>
[release/2.1] PBM decoder robustness improvements and BufferedReadStream
obse...</li>
<li><a
href="749b1c04d7"><code>749b1c0</code></a>
[release/2.1] Tiff decoding robustness improvements (<a
href="https://redirect.github.com/SixLabors/ImageSharp/issues/2550">#2550</a>)
(<a
href="https://redirect.github.com/SixLabors/ImageSharp/issues/2554">#2554</a>)</li>
<li><a
href="3064b78927"><code>3064b78</code></a>
Merge pull request <a
href="https://redirect.github.com/SixLabors/ImageSharp/issues/2553">#2553</a>
from SixLabors/backport/2.1.x/2545</li>
<li><a
href="f36ec12695"><code>f36ec12</code></a>
Disallow allocation attempts of unrepresentable sizes </li>
<li><a
href="688e242a84"><code>688e242</code></a>
Merge pull request <a
href="https://redirect.github.com/SixLabors/ImageSharp/issues/2524">#2524</a>
from SixLabors/js/backport-fix-jpeg-dos</li>
<li><a
href="0f17a8be9c"><code>0f17a8b</code></a>
Handle EOF in Jpeg bit reader when data is bad to prevent DOS
attack.</li>
<li>Additional commits viewable in <a
href="https://github.com/SixLabors/ImageSharp/compare/v2.1.1...v2.1.7">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=Sixlabors.ImageSharp&package-manager=nuget&previous-version=2.1.1&new-version=2.1.7)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/microsoft/onnxruntime/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-05 08:32:18 -07:00
..
ApiDocs Update c# dependencies (#18995) 2024-01-04 10:41:28 -08:00
sample Bump Sixlabors.ImageSharp from 2.1.1 to 2.1.7 in /csharp/sample/Microsoft.ML.OnnxRuntime.FasterRcnnSample (#19806) 2024-04-05 08:32:18 -07:00
src Expose SessionOtions.DisablePerSessionThreads (#19730) 2024-03-04 13:46:51 -08:00
test Expose SessionOtions.DisablePerSessionThreads (#19730) 2024-03-04 13:46:51 -08:00
testdata
tools Update MAUI model tester tool to .net8 (#19907) 2024-03-14 15:19:19 +10:00
.clang-format Add MAUI test app that can be used to test model loading and performance (#16658) 2023-07-18 08:21:18 +10:00
Directory.Build.props.in Patch Protobuf and ONNX's cmake files and enforce BinSkim check (#13694) 2022-11-18 10:09:47 -08:00
NuGet.CSharp.config Various fixes to the CSharp setup (#15782) 2023-05-05 14:27:30 +10:00
OnnxRuntime.CSharp.proj Split Onnxruntime Nuget GPU package (#18819) 2023-12-22 16:57:16 +08:00
OnnxRuntime.CSharp.sln Add csharp docfx (#12596) 2022-08-25 09:51:32 -05:00
OnnxRuntime.DesktopOnly.CSharp.sln
OnnxRuntime.snk
readme.md Basic CSharp packaging support for ROCm EP (#15535) 2023-05-16 07:27:38 +08:00
readme.txt

ORT C# Managed Library

The solution files here are used to produce nuget packages for the C# bindings.

Note that the project naming is currently confusing and needs updating.

  • The Microsoft.ML.OnnxRuntime project produces the Microsoft.ML.OnnxRuntime.Managed nuget package.
  • The Microsoft.ML.OnnxRuntime nuget package contains the native (i.e. C++) code for various platforms.

Solution files

The main solution file is OnnxRuntime.CSharp.sln. This includes desktop and Xamarin mobile projects. OnnxRuntime.DesktopOnly.CSharp.sln is a copy of that with all the mobile projects removed. This is due to there being no way to selectively exclude a csproj from the sln if Xamarin isn't available.

If changes are required, either update the main solution first and copy the relevant changes across, or copy the entire file and remove the mobile projects (anything with iOS, Android or Droid in the name).

Development setup:

Requirements:

Windows

NOTE: The usage of this solution is primarily for ORT developers creating the managed Microsoft.ML.OnnxRuntime.Managed nuget package. Due to that, the requirements are quite specific.

Visual Studio 2022 v17.2.4 or later, with Xamarin workloads

There's no good way to use Visual Studio 2022 17.3 Preview in a CI, so we currently have to build pre-.net6 targets using VS, and .net6 targets using dotnet. We can't build them all using dotnet as the xamarin targets require msbuild. We can't package them using dotnet as that also requires msbuild.

Once the official VS 2022 release supports .net6 and is available in the CI we can revert to the original simple setup of building everything using msbuild.

To test packaging locally you will also need nuget.exe. Download from https://www.nuget.org/downloads. Put in a folder (e.g. C:\Program Files (x86)\NuGet). Add that folder to your PATH.

Linux

  1. Install .Net SDK.
  2. Install Mono.
    wget http://download.mono-project.com/repo/xamarin.gpg && sudo apt-key add xamarin.gpg && rm xamarin.gpg
    echo "deb https://download.mono-project.com/repo/ubuntu stable-bionic main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
    sudo apt update -y && apt install -y mono-devel
    
  3. Install nupkg.exe
    wget https://dist.nuget.org/win-x86-commandline/latest/nuget.exe && sudo mv nuget.exe /usr/local/bin/nuget.exe
    echo 'mono /usr/local/bin/nuget.exe $@' | sudo tee /usr/local/bin/nuget
    chmod a+x /usr/local/bin/nuget
    

Magic incantations to build the nuget managed package locally:

Windows

If we're starting with VS 2022 17.2.4 we should have dotnet sdk 6.0.301

Make sure all the required workloads are installed dotnet workload install android ios maccatalyst macos - original example from here: - dotnet workload install android ios maccatalyst macos maui --source https://aka.ms/dotnet6/nuget/index.json --source https://api.nuget.org/v3/index.json - don't need 'maui' in this list until we update the sample/test apps - didn't seem to need --source arg/s for local build. YMMV.

Build pre-net6 targets msbuild -t:restore .\src\Microsoft.ML.OnnxRuntime\Microsoft.ML.OnnxRuntime.csproj -p:SelectedTargets=PreNet6 msbuild -t:build .\src\Microsoft.ML.OnnxRuntime\Microsoft.ML.OnnxRuntime.csproj -p:SelectedTargets=PreNet6

Need to run msbuild twice - once to restore which creates some json configs that are needed like Microsoft.ML.OnnxRuntime\obj\project.assets.json, and once to build using the configs.

Build net6 targets dotnet build .\src\Microsoft.ML.OnnxRuntime\Microsoft.ML.OnnxRuntime.csproj -p:SelectedTargets=Net6

The dotnet build does the restore internally.

Create project.assets.json in obj dir with all targets so the nuget package creation includes them all msbuild -t:restore .\src\Microsoft.ML.OnnxRuntime\Microsoft.ML.OnnxRuntime.csproj -p:SelectedTargets=All

Create nuget package msbuild .\OnnxRuntime.CSharp.proj -t:CreatePackage -p:OrtPackageId=Microsoft.ML.OnnxRuntime -p:Configuration=Debug -p:Platform="Any CPU"

Linux

For example, to build a CUDA GPU package, just run:

./build.sh \
  --config="Release" \
  --cmake_generator Ninja \
  --use_cuda \
    --cuda_home=/usr/local/cuda \
    --cudnn_home=/usr \
  --build_nuget \
  --msbuild_extra_options \
    /p:SelectedTargets=Net6 \
    /p:Net6Targets=net6.0 \
    /p:TargetFrameworks=netstandard2.0 \
    /p:IsLinuxBuild=true

Note: to build a pure CPU development package, you need to add /p:OrtPackageId="Microsoft.ML.OnnxRuntime" to --msbuild_extra_options. Otherwise, it will try to create Xamarin mobile targets which may not be properly configured on your devbox.

A .nupkg file will be produced at you build root, say, build/Release.

To consume the package, in your .net project,

nuget add <path/to/packages.nuget> -Source ./packages/
dotnet add package microsoft.ml.onnxruntime.managed -s ./packages --prerelease
dotnet add package microsoft.ml.onnxruntime.gpu -s ./packages --prerelease