CommunityToolkit / CommunityToolkit/Labs-IntelligentAPIs

[Spec]: Helper functions for pre and post processing

オープン
#11 コメント 0 件 リアクション 0 件 担当者 1 名 @amrutha95 が担当を希望しています GitHub で見る
主要言語
C#
スター
21
フォーク
0
PR マージ指標
30日以内にマージされた PR はありません

説明

## WinML Helper functions Specification document

The HelperFunctions project is a set of APIs that are designed to help developers using WinML with some of the common pre-processing and post-processing tasks.

### Image helpers

`public static async Task ConvertBitmapToVideoFrame(SoftwareBitmap softwareBitmap)`
Converts Bitmap to VideoFrame, which is accepted as a binding object
Arguments: `softwareBitmap` : The `SoftwareBitmap` object

`public static async Task ConvertVideoFrameToTensor(VideoFrame videoFrame, long[] size)`
Converts VideoFrame to Tensor. Useful in scenarios where Tensor manipulation is required, for example if image needs to be resized, transposed from NCHW to NWHC.
Arguments : videoframe : The VideoFrame object to be converted
Size : A long[] array containing the sizes of the each dimension of the tensor

`public static async Task ConvertStorageFileToSoftwareBitmap(StorageFile selectedStorageFile)`
Converts StorageFile to SoftwareBitmap
public static async Task ConvertStorageFileToSoftwareBitmap(StorageFile selectedStorageFile)
Arguments : selectedStorageFile : The StorageFile object that needs to be converted

`public static async Task ResizeImage(SoftwareBitmap bitmap, uint height, uint width)`
Resizes image based on given dimensions
public static async Task ResizeImage(SoftwareBitmap softwareBitmap, uint height, uint width)
Arguments : softwareBitmap: The SoftwareBitmap object that needs to be resized
height: Height of the image
width: Width of the image

`public static async Task Crop(SoftwareBitmap softwareBitmap, Rect bounds)`
Crops images based on bounds provided
Arguments : softwareBitmap: The SoftwareBitmap image to be cropped
bounds: The bounds of the cropped image

`ConvertNCHWToNWHC`
Transposes an image from NCHW to NWHC. Used depending on what the model is looking for in the input.
public static async Task ConvertNCHWToNWHC(SoftwareBitmap softwareBitmap)
Arguments: softwareBitmap: The SoftwareBitmap object to be transposed

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。