Skip to content

Instantly share code, notes, and snippets.

@olokobayusuf
Last active September 21, 2021 23:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save olokobayusuf/a66e4daae19a234823f8a4e97f08a87f to your computer and use it in GitHub Desktop.
Save olokobayusuf/a66e4daae19a234823f8a4e97f08a87f to your computer and use it in GitHub Desktop.
The core API in NatML.
// Load the ML model data
var modelData = MLModelData.FromFile("/path/to/model.onnx");
// Deserialize the model
var model = modelData.Deserialize();
// Print a model metadata value
Debug.Log("The model was created by: " + model["Author"]);
// Check the expected input size
var inputType = model.inputs[0] as MLImageType;
Debug.Log($"Model expects image with size: {inputType.width}x{inputType.height}");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment