AIKernel.Providers.Image
0.1.4
See the version list below for details.
dotnet add package AIKernel.Providers.Image --version 0.1.4
NuGet\Install-Package AIKernel.Providers.Image -Version 0.1.4
<PackageReference Include="AIKernel.Providers.Image" Version="0.1.4" />
<PackageVersion Include="AIKernel.Providers.Image" Version="0.1.4" />
<PackageReference Include="AIKernel.Providers.Image" />
paket add AIKernel.Providers.Image --version 0.1.4
#r "nuget: AIKernel.Providers.Image, 0.1.4"
#:package AIKernel.Providers.Image@0.1.4
#addin nuget:?package=AIKernel.Providers.Image&version=0.1.4
#tool nuget:?package=AIKernel.Providers.Image&version=0.1.4
AIKernel image provider
Local CPU processing for .NET 10 and the AIKernel 0.1.4 package family. Windows x64 includes its native OpenCV runtime. The application uses AIKernel.Contracts.Images and configures provider implementations at startup.
dotnet add package AIKernel.Providers.Image --version 0.1.4
using AIKernel.Contracts.Images;
using AIKernel.Providers.Image;
using var provider = new ImageEditProvider(backgroundModelPath: "models/birefnet-lite-512.onnx");
IImageEditProvider editor = provider;
var photo = await File.ReadAllBytesAsync("photo.jpg", cancellationToken);
var illustration = await editor.StylizeAsync(photo, "illustration", cancellationToken);
var cutout = await editor.RemoveBackgroundAsync(photo, cancellationToken);
await File.WriteAllBytesAsync("illustration.png", illustration, cancellationToken);
await File.WriteAllBytesAsync("cutout.png", cutout, cancellationToken);
- Styles are
illustration,pencil, anddetail. Pass no checkpoint when only using the OpenCV styles. - For background removal, download the pinned BiRefNet_lite FP32 ONNX file. The provider verifies its size and SHA-256 against
ImageEditProvider.BackgroundModelSha256before loading it. The session is reused between jobs. - Inputs are PNG (at most 8 bits per sample) and 8-bit JPEG. The defaults are 16 MiB encoded and 4,194,304 pixels decoded. Each image side is at most 8,192 pixels. Outputs preserve pixel dimensions. Background removal multiplies the soft matte by existing transparency.
- Await the operation before reusing the input buffer. Unsupported input, unknown style, and missing checkpoint throw exceptions. Cancellation can terminate ONNX inference. OpenCV completes the current native operation before observing cancellation. An editor runs one operation at a time.
To tag visible content, load an AIKernel-imported Cosmos 3 Edge reasoner with a trusted SHA-256 for import-manifest.json:
using var taggingProvider = new CosmosImageTagger(edgeDirectory, manifestSha256);
IImageTaggingProvider tagger = taggingProvider;
var tags = await tagger.TagAsync(photo, cancellationToken);
Tagging returns short English tags from the local reasoner. A host with a fixed RAM budget can supply CosmosMemoryOptions and a private SSD directory. The supported image operations use CPU execution. Model weights require separate provisioning. The package carries third-party notices for OpenCV, OpenCvSharp4, ONNX Runtime, and BiRefNet_lite.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- AIKernel.Contracts.Images (>= 0.1.4)
- AIKernel.Kernel (= 0.1.4)
- Microsoft.ML.OnnxRuntime (>= 1.32.0)
- OpenCvSharp4 (>= 4.13.0.20261107)
- OpenCvSharp4.runtime.win (>= 4.13.0.20261107)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial image provider for the AIKernel 0.1.4 release family.