onnx-tensor-math

Convert images to normalized 1x3x640x640 float32 tensors for ONNX RT-DETR inference.

7|1|Updated Feb 21, 2026
One-click install
npx skills add https://github.com/sparkeh9/DoclingDotNet --skill onnx-tensor-math
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: onnx-tensor-math
Source: https://github.com/sparkeh9/DoclingDotNet/tree/main/.agent/skills/onnx-tensor-math
Command: npx skills add https://github.com/sparkeh9/DoclingDotNet --skill onnx-tensor-math

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Preprocesses an image into a normalized 1x3x640x640 float32 tensor suitable for ONNX RT-DETR inference in .NET.

Core Features & Use Cases

  • High-performance image-to-tensor preprocessing using SkiaSharp and unsafe memory access.
  • Supports 640x640 RGB input with a [1,3,640,640] (NCHW) layout and deterministic normalization.
  • Enforces standard normalization: scale 1/255, mean [0.485, 0.456, 0.406], std [0.229, 0.224, 0.225].
  • Cross-platform and memory-safe resource handling with explicit disposal of SkiaSharp objects.
  • Use Case: prepare frames from images or video streams for RT-DETR layout inference in .NET.

Quick Start

Instantiate a SkiaSharp bitmap, resize to 640x640, and convert to a 1x3x640x640 float tensor using the specified mean and std.

Frequently Asked Questions about onnx-tensor-math

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I preprocess an image into an ONNX tensor for RT-DETR inference in .NET?

You can preprocess an image into an ONNX tensor by resizing it to 640x640 RGB, converting it to a 1x3x640x640 float32 tensor, and applying normalization using scale, mean, and standard deviation values for RT-DETR inference.

What normalization values are required for ONNX RT-DETR image preprocessing?

Standard RT-DETR image preprocessing requires a scale of 1/255, a mean of [0.485, 0.456, 0.406], and a standard deviation of [0.229, 0.224, 0.225] to produce deterministic normalized float32 tensors.

Does SkiaSharp support high-performance image-to-tensor conversion in .NET?

Yes, SkiaSharp supports high-performance image-to-tensor conversion in .NET by providing cross-platform image handling and enabling unsafe memory access to quickly generate normalized ONNX-ready float32 tensors.

Can I use video stream frames for ONNX RT-DETR tensor preprocessing?

Yes, you can preprocess video stream frames for ONNX RT-DETR inference by converting each frame into a normalized 1x3x640x640 float32 tensor using the specified SkiaSharp cross-platform image handling pipeline.

What is the correct tensor layout for RT-DETR image preprocessing in ONNX?

The correct tensor layout for RT-DETR image preprocessing is a 1x3x640x640 NCHW float32 tensor, enforcing a 640x640 RGB input to ensure compatibility with ONNX inference models.

Why do I need to dispose of SkiaSharp resources during image-to-tensor conversion?

You need to explicitly dispose of SkiaSharp resources during image-to-tensor conversion to ensure memory-safe handling and prevent resource leaks when generating normalized tensors for ONNX inference.