Anonymous View
ONNX Runtime JavaScript API
    Preparing search index...

    Interface InferenceSessionFactory

    interface InferenceSessionFactory {
        create(uri: string, options?: SessionOptions): Promise<InferenceSession>;
        create(
            buffer: ArrayBufferLike,
            options?: SessionOptions,
        ): Promise<InferenceSession>;
        create(
            buffer: ArrayBufferLike,
            byteOffset: number,
            byteLength?: number,
            options?: SessionOptions,
        ): Promise<InferenceSession>;
        create(
            buffer: Uint8Array,
            options?: SessionOptions,
        ): Promise<InferenceSession>;
    }
    Index

    Methods

    Methods

    • Create a new inference session and load model asynchronously from an ONNX model file.

      Parameters

      • uri: string

        The URI or file path of the model to load.

      • Optionaloptions: SessionOptions

        specify configuration for creating a new inference session.

      Returns Promise<InferenceSession>

      A promise that resolves to an InferenceSession object.

    • Create a new inference session and load model asynchronously from an array bufer.

      Parameters

      • buffer: ArrayBufferLike

        An ArrayBuffer representation of an ONNX model.

      • Optionaloptions: SessionOptions

        specify configuration for creating a new inference session.

      Returns Promise<InferenceSession>

      A promise that resolves to an InferenceSession object.

    • Create a new inference session and load model asynchronously from segment of an array bufer.

      Parameters

      • buffer: ArrayBufferLike

        An ArrayBuffer representation of an ONNX model.

      • byteOffset: number

        The beginning of the specified portion of the array buffer.

      • OptionalbyteLength: number

        The length in bytes of the array buffer.

      • Optionaloptions: SessionOptions

        specify configuration for creating a new inference session.

      Returns Promise<InferenceSession>

      A promise that resolves to an InferenceSession object.

    • Create a new inference session and load model asynchronously from a Uint8Array.

      Parameters

      • buffer: Uint8Array

        A Uint8Array representation of an ONNX model.

      • Optionaloptions: SessionOptions

        specify configuration for creating a new inference session.

      Returns Promise<InferenceSession>

      A promise that resolves to an InferenceSession object.