docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ModelLoader

    Barracuda Model loader

    Inheritance
    object
    ModelLoader
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Unity.Barracuda
    Assembly: solution.dll
    Syntax
    public static class ModelLoader

    Methods

    Load(byte[], bool, bool)

    Return an object oriented representation (aka: Model) of a neural network from a byte[] array. By default details are not logged to the console, set verbose to true to see loading details.

    Declaration
    public static Model Load(byte[] stream, bool verbose = false, bool skipWeights = false)
    Parameters
    Type Name Description
    byte[] stream

    binary representation of model as a byte array

    bool verbose

    verbose

    bool skipWeights

    skip loading weights (fast loading, metadata only)

    Returns
    Type Description
    Model

    loaded Model

    Load(string, bool, bool)

    Return an object oriented representation (aka: Model) of a neural network from a .bc file. By default details are not logged to the console, set verbose to true to see loading details.

    Declaration
    public static Model Load(string filepath, bool verbose = false, bool skipWeights = false)
    Parameters
    Type Name Description
    string filepath

    file name

    bool verbose

    verbose

    bool skipWeights

    skip loading weights (fast loading, metadata only)

    Returns
    Type Description
    Model

    loaded Model

    Load(NNModel, bool, bool)

    Return an object oriented representation (aka: Model) of a neural network from a binary representation of type NNModel. By default details are not logged to the console, set verbose to true to see loading details.

    Declaration
    public static Model Load(NNModel model, bool verbose = false, bool skipWeights = false)
    Parameters
    Type Name Description
    NNModel model

    model

    bool verbose

    verbose

    bool skipWeights

    skip loading weights (fast loading, metadata only)

    Returns
    Type Description
    Model

    loaded Model

    LoadAsync(byte[], Model, bool, bool, float)

    Return an object oriented representation (aka: Model) of a neural network from a byte[] array. By default details are not logged to the console, set verbose to true to see loading details.

    Declaration
    public static IEnumerator LoadAsync(byte[] stream, Model model, bool verbose = false, bool skipWeights = false, float maxTimePerYield = 0.01)
    Parameters
    Type Name Description
    byte[] stream

    binary representation of model as a byte array

    Model model

    object-oriented representation of model (must initialize before calling method)

    bool verbose

    verbose

    bool skipWeights

    skip loading weights (fast loading, metadata only)

    float maxTimePerYield

    the maximum amount of time to spend between in computation before yielding

    Returns
    Type Description
    IEnumerator

    IEnumerator (use with StartCoroutine)

    LoadAsync(string, Model, bool, bool, float)

    Return an object oriented representation (aka: Model) of a neural network from a .bc file. By default details are not logged to the console, set verbose to true to see loading details.

    Declaration
    public static IEnumerator LoadAsync(string filepath, Model model, bool verbose = false, bool skipWeights = false, float maxTimePerYield = 0.01)
    Parameters
    Type Name Description
    string filepath

    file name

    Model model

    object-oriented representation of model (must initialize before calling method)

    bool verbose

    verbose

    bool skipWeights

    skip loading weights (fast loading, metadata only)

    float maxTimePerYield

    the maximum amount of time to spend between in computation before yielding

    Returns
    Type Description
    IEnumerator

    IEnumerator (use with StartCoroutine)

    LoadAsync(NNModel, Model, bool, bool, float)

    Return an object oriented representation (aka: Model) of a neural network from a binary representation of type NNModel. By default details are not logged to the console, set verbose to true to see loading details.

    Declaration
    public static IEnumerator LoadAsync(NNModel nnModel, Model model, bool verbose = false, bool skipWeights = false, float maxTimePerYield = 0.01)
    Parameters
    Type Name Description
    NNModel nnModel

    binary representation of model

    Model model

    object-oriented representation of model (must initialize before calling method)

    bool verbose

    verbose

    bool skipWeights

    skip loading weights (fast loading, metadata only)

    float maxTimePerYield

    the maximum amount of time to spend between in computation before yielding

    Returns
    Type Description
    IEnumerator

    IEnumerator (use with StartCoroutine)

    LoadAsyncFromStreamingAssets(string, Model, bool, bool, float)

    Return an object oriented representation (aka: Model) of a neural network from a .bc file from the the streaming asset folder. By default details are not logged to the console, set verbose to true to see loading details.

    Declaration
    public static IEnumerator LoadAsyncFromStreamingAssets(string filename, Model model, bool verbose = false, bool skipWeights = false, float maxTimePerYield = 0.01)
    Parameters
    Type Name Description
    string filename

    file name

    Model model

    object-oriented representation of model (must initialize before calling method)

    bool verbose

    verbose

    bool skipWeights

    skip loading weights (fast loading, metadata only)

    float maxTimePerYield

    the maximum amount of time to spend between in computation before yielding

    Returns
    Type Description
    IEnumerator

    IEnumerator (use with StartCoroutine)

    LoadFromStreamingAssets(string, bool, bool)

    Return an object oriented representation (aka: Model) of a neural network from a .bc file from the the streaming asset folder. By default details are not logged to the console, set verbose to true to see loading details.

    Declaration
    public static Model LoadFromStreamingAssets(string filename, bool verbose = false, bool skipWeights = false)
    Parameters
    Type Name Description
    string filename

    file name

    bool verbose

    verbose

    bool skipWeights

    skip loading weights (fast loading, metadata only)

    Returns
    Type Description
    Model

    loaded Model

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)