OnnxStack.ImageUpscaler 0.39.0 (original) (raw)

Upscale Models

Below is a small list of known/tested upscale models

Image Example

// Load Input Image
var inputImage = await OnnxImage.FromFileAsync("Input.png");

// Create Pipeline
var pipeline = ImageUpscalePipeline.CreatePipeline("SwinIR-M_x4_GAN.onnx", scaleFactor: 4);

// Run pipeline
var result = await pipeline.RunAsync(inputImage);

// Save Image File
await result.SaveAsync("Result.png");

// Unload
await pipeline.UnloadAsync();

Video Example

// Load Input Video
var inputVideo = await OnnxVideo.FromFileAsync("Input.mp4");

// Create Pipeline
var pipeline = ImageUpscalePipeline.CreatePipeline("SwinIR-M_x4_GAN.onnx", scaleFactor: 4);

// Run pipeline
var result = await pipeline.RunAsync(inputVideo);

// Save Video File
await result.SaveAsync("Result.mp4");

// Unload
await pipeline.UnloadAsync();

Video Stream Example

// Read Video Info
var videoFile = "Input.mp4";
var videoInfo = await VideoHelper.ReadVideoInfoAsync(videoFile);

// Create Video Stream
var videoStream = VideoHelper.ReadVideoStreamAsync(videoFile, videoInfo.FrameRate);

// Create pipeline
var pipeline = ImageUpscalePipeline.CreatePipeline("SwinIR-M_x4_GAN.onnx", scaleFactor: 4);

// Create Pipeline Stream
var pipelineStream = pipeline.RunAsync(videoStream);

// Write Video Stream
await VideoHelper.WriteVideoStreamAsync(videoInfo, pipelineStream, "Result.mp4");

//Unload
await pipeline.UnloadAsync();
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.