ImageVariableDescriptorPreview Class

Definition

Deprecated. Represents the image descriptor information.

public ref class ImageVariableDescriptorPreview sealed
class ImageVariableDescriptorPreview sealed
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract), 65536)]
public sealed class ImageVariableDescriptorPreview
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract), 65536)]
[Windows.Foundation.Metadata.Deprecated("Use ImageFeatureDescriptor instead of ImageVariableDescriptorPreview. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 131072, "Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract")]
public sealed class ImageVariableDescriptorPreview
Public NotInheritable Class ImageVariableDescriptorPreview
Inheritance
ImageVariableDescriptorPreview
Attributes
Implements

Windows 10 requirements

Device family
Windows 10, version 1809 (introduced in 10.0.17763.0)
API contract
Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract (introduced in v2.0)

Examples

public void Evaluator(LearningModelPreview model)
{
	// Retrieve the first input feature which is an image
    ILearningModelVariableDescriptorPreview inputImageFeatureDescription = model.Description.InputFeatures.FirstOrDefault(feature=>feature.ModelFeatureKind == LearningModelFeatureKindPreview.Image);
 
    ImageVariableDescriptorPreview imageDescriptor = (ImageVariableDescriptorPreview)inputImageFeatureDescription;

	// Ensure the input feature handles the format RGBA8
    if (imageDescriptor.BitmapPixelFormat != BitmapPixelFormat.Rgba8)
    {
        Console.WriteLine($"Input Feature Name: {imageDescriptor.Name}. Format not supported.");
    }

 }

Remarks

Warning

This is a deprecated API. Please use the Windows.AI.MachineLearning namespace instead.

Properties

BitmapPixelFormat

Deprecated. Gets the pixel format of the image.

Description

Deprecated. Gets the description of the image variable.

Height

Deprecated. Gets the height of the image variable.

IsRequired

Deprecated. Gets whether the image variable is required.

ModelFeatureKind

Deprecated. Gets the data type of the variable.

Name

Deprecated. Gets the name of the image variable.

Width

Deprecated. Gets the width of the image variable.

Applies to