Unity
  • NatML for Unity
  • Preliminaries
    • Getting Started
    • Requirements
  • Workflows
    • Core Concepts
    • Fetching Models
    • Using Predictors
  • Authoring
    • Creating Predictors
    • Distributing Predictors
  • API Reference
    • IMLPredictor
    • MLModel
      • MLEdgeModel
        • Configuration
      • MLCloudModel
    • MLFeature
      • MLArrayFeature
      • MLImageFeature
      • MLStringFeature
      • MLAudioFeature
      • MLVideoFeature
      • MLDepthFeature
      • MLXRCpuDepthFeature
    • MLFeatureType
      • MLArrayType
      • MLAudioType
      • MLImageType
      • MLVideoType
      • MLStringType
    • MLPredictorExtensions
  • Integrations
    • Media Devices
    • Augmented Reality
    • Video Recording
  • Insiders
    • Changelog
    • Open Source
    • GitHub
    • Discord
    • Blog
Powered by GitBook
On this page
  • Creating the Feature
  • From a Video File
  • From Streaming Assets
  • Inspecting the Feature
  • Feature Type
  • Video Path
  • Video Width
  • Video Height
  • Video Frame Count
  • Handling Normalization
  • Handling Aspect Mode
  • Enumerating Video Frames
  • Creating Cloud Features

Was this helpful?

  1. API Reference
  2. MLFeature

MLVideoFeature

class NatML.Features.MLVideoFeature : MLFeature, IMLCloudFeature, IEnumerable<(MLImageFeature feature, long timestamp)>

INCOMPLETE.

Creating the Feature

INCOMPLETE.

From a Video File

/// <summary>
/// Create an video feature from a video file.
/// </summary>
/// <param name="path">Video file path.</param>
MLVideoFeature (string path);

INCOMPLETE.

From Streaming Assets

/// <summary>
/// Create a video feature from a video file in the `StreamingAssets` folder.
/// </summary>
/// <param name="relativePath">Relative path to video file in `StreamingAssets` folder.</param>
/// <returns>Video feature or `null` if no valid video can be found at the relative path.</returns>
static Task<MLVideoFeature> FromStreamingAssets (string relativePath);

INCOMPLETE.

Inspecting the Feature

INCOMPLETE

Feature Type

/// <summary>
/// Feature type.
/// </summary>
MLFeatureType type { get; }

Video Path

/// <summary>
/// Video path.
/// </summary>
string path { get; }

The video feature provides the full path of its source video.

The video path always refers to an accessible file on the local file system.

Video Width

/// <summary>
/// Video width.
/// </summary>
int width { get; }

The video feature provides the width of its source video in pixels.

Video Height

/// <summary>
/// Video height.
/// </summary>
int height { get; }

The video feature provides the height of its source video in pixels.

Video Frame Count

/// <summary>
/// Video frame count.
/// </summary>
int frames { get; }

The video feature provides the frame count of its source video.

Note that the reported frame count is merely an approximate count based on the average frame rate and duration of the source video. Enumerate the video to get an exact count.

Handling Normalization

/// <summary>
/// Normalization mean.
/// </summary>
Vector4 mean { get; set; }

/// <summary>
/// Normalization standard deviation.
/// </summary>
Vector4 std { get; set }

Handling Aspect Mode

/// <summary>
/// Aspect mode.
/// </summary>
MLImageFeature.AspectMode aspectMode { get; set; }

Enumerating Video Frames

INCOMPLETE.

Creating Cloud Features

/// <summary>
/// Create a Cloud ML feature that is ready for prediction with Cloud ML models.
/// </summary>
/// <param name="featureType">Optional feature type used to create the Cloud ML feature.</param>
/// <returns>Cloud ML feature.</returns>
MLCloudFeature IMLCloudFeature.Create (in MLFeatureType featureType = default);

INCOMPLETE.

PreviousMLAudioFeatureNextMLDepthFeature

Last updated 2 years ago

Was this helpful?

Refer to the section of the class for more information.

The type is always an .

See the section of the class for more information.

See the section of the class for more information.

MLVideoType
MLFeature
MLImageFeature
MLImageFeature
Handling Normalization
Handling Aspect Mode
Inspecting the Feature