OnnxRuntime Image Feature Extractor Library for .NET
$ dotnet add package OnnxStack.FeatureExtractorhttps://huggingface.co/axodoxian/controlnet_onnx/resolve/main/annotators/canny.onnx
https://huggingface.co/axodoxian/controlnet_onnx/resolve/main/annotators/hed.onnx
https://huggingface.co/axodoxian/controlnet_onnx/resolve/main/annotators/depth.onnx https://huggingface.co/Xenova/depth-anything-large-hf/onnx/model.onnx https://huggingface.co/julienkay/sentis-MiDaS
https://huggingface.co/axodoxian/controlnet_onnx/resolve/main/annotators/openpose.onnx
// Load Input Image
var inputImage = await OnnxImage.FromFileAsync("Input.png");
// Load Pipeline
var pipeline = FeatureExtractorPipeline.CreatePipeline("canny.onnx");
// Run Pipeline
var imageFeature = await pipeline.RunAsync(inputImage);
// Save Image
await imageFeature.Image.SaveAsync("Result.png");
//Unload
await pipeline.UnloadAsync();
// Load Input Video
var inputVideo = await OnnxVideo.FromFileAsync("Input.mp4");
// Load Pipeline
var pipeline = FeatureExtractorPipeline.CreatePipeline("canny.onnx");
// Run Pipeline
var videoFeature = await pipeline.RunAsync(inputVideo);
// Save Video
await videoFeature.SaveAsync("Result.mp4");
//Unload
await pipeline.UnloadAsync();