From 21bf6ab80bddc1a281ee69c78582a19a848da82d Mon Sep 17 00:00:00 2001 From: Sebastian Golebiewski Date: Tue, 12 Mar 2024 09:03:02 +0100 Subject: [PATCH] [DOCS] Add Node.js docs to API for master (#23195) Adding docs for OpenVINO Node.JS API. Porting: https://github.com/openvinotoolkit/openvino/pull/23189 --- docs/sphinx_setup/api/api_reference.rst | 5 +- docs/sphinx_setup/api/nodejs_api/addon.rst | 130 ++++++++++ .../api/nodejs_api/nodejs_api.rst | 197 ++------------- .../openvino-node/enums/element.rst | 119 +++++++++ .../openvino-node/enums/resizeAlgorithm.rst | 37 +++ .../interfaces/CompiledModel.rst | 107 +++++++++ .../openvino-node/interfaces/Core.rst | 166 +++++++++++++ .../interfaces/CoreConstructor.rst | 23 ++ .../openvino-node/interfaces/InferRequest.rst | 227 ++++++++++++++++++ .../openvino-node/interfaces/InputInfo.rst | 56 +++++ .../interfaces/InputModelInfo.rst | 32 +++ .../interfaces/InputTensorInfo.rst | 74 ++++++ .../openvino-node/interfaces/Model.rst | 110 +++++++++ .../openvino-node/interfaces/Output.rst | 107 +++++++++ .../openvino-node/interfaces/OutputInfo.rst | 28 +++ .../interfaces/OutputTensorInfo.rst | 48 ++++ .../openvino-node/interfaces/PartialShape.rst | 72 ++++++ .../interfaces/PartialShapeConstructor.rst | 31 +++ .../interfaces/PrePostProcessor.rst | 73 ++++++ .../PrePostProcessorConstructor.rst | 30 +++ .../interfaces/PreProcessSteps.rst | 32 +++ .../openvino-node/interfaces/Tensor.rst | 75 ++++++ .../interfaces/TensorConstructor.rst | 38 +++ .../openvino-node/types/Dimension.rst | 9 + .../types/SupportedTypedArray.rst | 11 + .../openvino-node/types/elementTypeString.rst | 9 + 26 files changed, 1672 insertions(+), 174 deletions(-) create mode 100644 docs/sphinx_setup/api/nodejs_api/addon.rst create mode 100644 docs/sphinx_setup/api/nodejs_api/openvino-node/enums/element.rst create mode 100644 docs/sphinx_setup/api/nodejs_api/openvino-node/enums/resizeAlgorithm.rst create mode 100644 docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/CompiledModel.rst create mode 100644 docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/Core.rst create mode 100644 docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/CoreConstructor.rst create mode 100644 docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/InferRequest.rst create mode 100644 docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/InputInfo.rst create mode 100644 docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/InputModelInfo.rst create mode 100644 docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/InputTensorInfo.rst create mode 100644 docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/Model.rst create mode 100644 docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/Output.rst create mode 100644 docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/OutputInfo.rst create mode 100644 docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/OutputTensorInfo.rst create mode 100644 docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/PartialShape.rst create mode 100644 docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/PartialShapeConstructor.rst create mode 100644 docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/PrePostProcessor.rst create mode 100644 docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/PrePostProcessorConstructor.rst create mode 100644 docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/PreProcessSteps.rst create mode 100644 docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/Tensor.rst create mode 100644 docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/TensorConstructor.rst create mode 100644 docs/sphinx_setup/api/nodejs_api/openvino-node/types/Dimension.rst create mode 100644 docs/sphinx_setup/api/nodejs_api/openvino-node/types/SupportedTypedArray.rst create mode 100644 docs/sphinx_setup/api/nodejs_api/openvino-node/types/elementTypeString.rst diff --git a/docs/sphinx_setup/api/api_reference.rst b/docs/sphinx_setup/api/api_reference.rst index 73dcb1ccefd..aee12add029 100644 --- a/docs/sphinx_setup/api/api_reference.rst +++ b/docs/sphinx_setup/api/api_reference.rst @@ -13,10 +13,11 @@ API Reference ie_python_api/api c_cpp_api/group__ov__cpp__api c_cpp_api/group__ov__c__api - nodejs_api/nodejs_api.rst + OpenVINO Node.js API -OpenVINO toolkit offers **APIs for Python, C++, C, and JavaScript (Node.js)** which share most features (C++ being the + +OpenVINO toolkit offers **APIs for Python, C, and C++** which share most features (C++ being the most comprehensive one), have a common structure, naming convention styles, namespaces, and no duplicate structures. diff --git a/docs/sphinx_setup/api/nodejs_api/addon.rst b/docs/sphinx_setup/api/nodejs_api/addon.rst new file mode 100644 index 00000000000..a3a3b9722e1 --- /dev/null +++ b/docs/sphinx_setup/api/nodejs_api/addon.rst @@ -0,0 +1,130 @@ +Property addon +=================== + +.. meta:: + :description: Explore the modules of openvino-node in Node.js API and their implementation + in Intel® Distribution of OpenVINO™ Toolkit. + +.. toctree:: + :maxdepth: 3 + :hidden: + + element <./openvino-node/enums/element> + resizeAlgorithm <./openvino-node/enums/resizeAlgorithm> + CompiledModel <./openvino-node/interfaces/CompiledModel> + Core <./openvino-node/interfaces/Core> + CoreConstructor <./openvino-node/interfaces/CoreConstructor> + InferRequest <./openvino-node/interfaces/InferRequest> + InputInfo <./openvino-node/interfaces/InputInfo> + InputModelInfo <./openvino-node/interfaces/InputModelInfo> + InputTensorInfo <./openvino-node/interfaces/InputTensorInfo> + Model <./openvino-node/interfaces/Model> + Output <./openvino-node/interfaces/Output> + OutputInfo <./openvino-node/interfaces/OutputInfo> + OutputTensorInfo <./openvino-node/interfaces/OutputTensorInfo> + PartialShape <./openvino-node/interfaces/PartialShape> + PartialShapeConstructor <./openvino-node/interfaces/PartialShapeConstructor> + PrePostProcessor <./openvino-node/interfaces/PrePostProcessor> + PrePostProcessorConstructor <./openvino-node/interfaces/PrePostProcessorConstructor> + PreProcessSteps <./openvino-node/interfaces/PreProcessSteps> + Tensor <./openvino-node/interfaces/Tensor> + TensorConstructor <./openvino-node/interfaces/TensorConstructor> + + +The **openvino-node** package exports ``addon`` which contains the following properties: + +.. code-block:: json + + interface NodeAddon { + Core: CoreConstructor; + PartialShape: PartialShapeConstructor; + Tensor: TensorConstructor; + element: typeof element; + preprocess: { + PrePostProcessor: PrePostProcessorConstructor; + resizeAlgorithm: typeof resizeAlgorithm; + }; + } + +- Defined in + `addon.ts:164 `__ + +Properties +##################### + +.. rubric:: Core + + +.. code-block:: json + + Core: CoreConstructor + +.. rubric:: Type declaration + +- CoreConstructor: :doc:`CoreConstructor <./openvino-node/interfaces/CoreConstructor>` +- Defined in + `addon.ts:165 `__ + + +.. rubric:: PartialShape + + + +.. code-block:: json + + PartialShape: PartialShapeConstructor + +.. rubric:: Type declaration + +- PartialShapeConstructor: :doc:`PartialShapeConstructor <./openvino-node/interfaces/PartialShapeConstructor>` +- Defined in + `addon.ts:167 `__ + +.. rubric:: Tensor + + +.. code-block:: json + + Tensor: TensorConstructor + +.. rubric:: Type declaration + +- TensorConstructor: :doc:`TensorConstructor <./openvino-node/interfaces/TensorConstructor>` + +- Defined in + `addon.ts:166 `__ + +.. rubric:: element + + + +.. code-block:: json + + element: typeof element + +.. rubric:: Type declaration + +- element:typeof :doc:`element <./openvino-node/enums/element>` +- Defined in + `addon.ts:173 `__ + +.. rubric:: preprocess + + + +.. code-block:: json + + preprocess: { + PrePostProcessor: PrePostProcessorConstructor; + resizeAlgorithm: typeof resizeAlgorithm; + } + + +.. rubric:: Type declaration + + +- PrePostProcessor: :doc:`PrePostProcessorConstructor <./openvino-node/interfaces/PrePostProcessorConstructor>` +- resizeAlgorithm:typeof :doc:`resizeAlgorithm <./openvino-node/enums/resizeAlgorithm>` + +- Defined in + `addon.ts:169 `__ diff --git a/docs/sphinx_setup/api/nodejs_api/nodejs_api.rst b/docs/sphinx_setup/api/nodejs_api/nodejs_api.rst index b42a4adf748..f71424d0529 100644 --- a/docs/sphinx_setup/api/nodejs_api/nodejs_api.rst +++ b/docs/sphinx_setup/api/nodejs_api/nodejs_api.rst @@ -1,193 +1,46 @@ -OpenVINO Node.js API -===================== +OpenVINO™ Node.js Bindings +========================== .. meta:: :description: Explore Node.js API and implementation of its features in Intel® Distribution of OpenVINO™ Toolkit. +.. toctree:: + :maxdepth: 3 + :hidden: -OpenVINO Node.js API is distributed as an *openvino-node* npm package that contains JavaScript -wrappers with TypeScript types descriptions and a script that downloads the OpenVINO Node.js -bindings for current OS.⠀ + addon <./addon> -Use openvino-node package -######################### +Use OpenVINO JavaScript API for your Node.js application. -1. Import openvino-node package. Use the ``addon`` property to reach general exposed entities: - - .. code-block:: js - - const { addon: ov } = require('openvino-node'); - - -2. Load and compile a model, then prepare a tensor with input data. Finally, run inference - on the model with it to get the model output tensor: - - .. code-block:: js - - const { addon: ov } = require('openvino-node'); - // Load model - const core = new ov.Core(); - const model = await ov.readModel('path/to/model', 'path/to/model/weights'); - // Compile model - const compiledModel = await ov.compileModel(model, 'CPU'); - // Prepare tensor with input data - const tensorData = new Float32Array(image.data); - const shape = [1, image.rows, image.cols, 3]; - const inputTensor = new ov.Tensor(ov.element.f32, shape, tensorData); - const inferRequest = compiledModel.createInferRequest(); - const modelOutput = inferRequest.infer([inputTensor]); - - -For more extensive examples of use, refer to the following scripts: - -- `Hello Classification Sample `__ -- `Hello Reshape SSD Sample `__ -- `Image Classification Async Sample `__ - -OpenVINO API features +Usage ##################### -.. list-table:: - :widths: 15 85 - :class: nodejs-features +1. Install the **openvino-node** package: - * - ``addon`` - - - .. code-block:: ts + .. code-block:: - Core() - Tensor() - PartialShape() - element - preprocess: - resizeAlgorithms - PrePostProcessor() + npm install openvino-node - * - ``CompiledModel`` - - - .. code-block:: ts +2. Use the **openvino-node** package: - outputs: Output[] - inputs: Output[] - constructor() - output(nameOrId?: string | number): Output - input(nameOrId?: string | number): Output - createInferRequest(): InferRequest + .. code-block:: - * - ``Core`` - - - .. code-block:: ts + const { addon: ov } = require('openvino-node'); - constructor() - compileModel(model: Model, device: string, config?: { [option: string]: string }): Promise - compileModelSync(model: Model, device: string, config?: { [option: string]: string }): CompiledModel - readModel(modelPath: string, binPath?: string): Promise - readModel(modelBuffer: Uint8Array, weightsBuffer?: Uint8Array): Promise; - readModelSync(modelPath: string, binPath?: string): Model - readModelSync(modelBuffer: Uint8Array, weightsBuffer?: Uint8Array): Model; - * - ``InferRequest`` - - - .. code-block:: ts +Build From Sources +##################### - constructor() - setTensor(name: string, tensor: Tensor): void - setInputTensor(idxOrTensor: number | Tensor, tensor?: Tensor): void - setOutputTensor(idxOrTensor: number | Tensor, tensor?: Tensor): void - getTensor(nameOrOutput: string | Output): Tensor - getInputTensor(idx?: number): Tensor - getOutputTensor(idx?: number): Tensor - getCompiledModel(): CompiledModel - inferAsync(inputData?: { [inputName: string]: Tensor |SupportedTypedArray} | Tensor[] | SupportedTypedArray[]): Promise<{ [outputName: string] : Tensor}>; - infer(inputData?: { [inputName: string]: Tensor |SupportedTypedArray} | Tensor[] | SupportedTypedArray[]): { [outputName: string] : Tensor}; +For more details, refer to the +`OpenVINO™ JavaScript API Developer Documentation +`__ - * - ``InputInfo`` - - - .. code-block:: ts - tensor(): InputTensorInfo; - preprocess(): PreProcessSteps; - model(): InputModelInfo; - - * - ``InputModelInfo`` - - - .. code-block:: ts - - setLayout(layout: string): InputModelInfo; - - * - ``InputTensorInfo`` - - - .. code-block:: ts - - setElementType(elementType: element | elementTypeString ): InputTensorInfo; - setLayout(layout: string): InputTensorInfo; - setShape(shape: number[]): InputTensorInfo; - - * - ``Model`` - - - .. code-block:: ts - - outputs: Output[] - inputs: Output[] - output(nameOrId?: string | number): Output - input(nameOrId?: string | number): Output - getName(): string - - * - ``Output`` - - - .. code-block:: ts - - anyName: string; - shape: number[]; - - constructor() - toString(): string - getAnyName(): string - getShape(): number[] - getPartialShape(): number[] - - * - ``OutputInfo`` - - - .. code-block:: ts - - tensor(): OutputTensorInfo; - - * - ``OutputTensorInfo`` - - - .. code-block:: ts - - setElementType(elementType: element | elementTypeString ): InputTensorInfo; - setLayout(layout: string): InputTensorInfo; - - * - ``PrePostProcessor`` - - - .. code-block:: ts - - constructor(model: Model) - build(): PrePostProcessor - input(): InputInfo - output(): OutputInfo - - * - ``preprocess.element`` - - u8, u16, u32, i8, i16, i32, i64, f32, f64 - - * - ``preprocess.resizeAlgorithm`` - - RESIZE_CUBIC, RESIZE_LINEAR - - * - ``PreProcessSteps`` - - - .. code-block:: ts - - resize(algorithm: resizeAlgorithm | string): PreProcessSteps; - - * - ``Tensor`` - - - .. code-block:: ts - - data: number[] - constructor(type: element, shape: number[], tensorData?: number[] | SupportedTypedArray): Tensor - getElementType(): element - getShape(): number[] - getData(): number[] +Additional Resources +##################### +- `OpenVINO™ Node.js Bindings Examples of Usage `__ +- `OpenVINO™ Core Components `__ +- `OpenVINO™ Python API `__ +- `OpenVINO™ Other Bindings `__ \ No newline at end of file diff --git a/docs/sphinx_setup/api/nodejs_api/openvino-node/enums/element.rst b/docs/sphinx_setup/api/nodejs_api/openvino-node/enums/element.rst new file mode 100644 index 00000000000..15ba7936928 --- /dev/null +++ b/docs/sphinx_setup/api/nodejs_api/openvino-node/enums/element.rst @@ -0,0 +1,119 @@ +Enumeration element +=================== + +.. rubric:: f32 + + + +.. code-block:: json + + f32: number + +- Defined in + `addon.ts:154 `__ + + +.. rubric:: f64 + + +.. code-block:: json + + f64: number + +- Defined in + `addon.ts:155 `__ + + +.. rubric:: i16 + + +.. code-block:: json + + i16: number + +- Defined in + `addon.ts:151 `__ + + +.. rubric:: i32 + + + +.. code-block:: json + + i32: number + +- Defined in + `addon.ts:152 `__ + + +.. rubric:: i64 + + + +.. code-block:: json + + i64: number + +- Defined in + `addon.ts:153 `__ + + +.. rubric:: i8 + + + +.. code-block:: json + + i8: number + +- Defined in + `addon.ts:150 `__ + + +.. rubric:: u16 + + + +.. code-block:: json + + u16: number + +- Defined in + `addon.ts:148 `__ + + +.. rubric:: u32 + + + +.. code-block:: json + + u32: number + +- Defined in + `addon.ts:147 `__ + + +.. rubric:: u64 + + + +.. code-block:: json + + u64: number + +- Defined in + `addon.ts:149 `__ + + +.. rubric:: u8 + + + +.. code-block:: json + + u8: number + +- Defined in + `addon.ts:146 `__ diff --git a/docs/sphinx_setup/api/nodejs_api/openvino-node/enums/resizeAlgorithm.rst b/docs/sphinx_setup/api/nodejs_api/openvino-node/enums/resizeAlgorithm.rst new file mode 100644 index 00000000000..340e5afe816 --- /dev/null +++ b/docs/sphinx_setup/api/nodejs_api/openvino-node/enums/resizeAlgorithm.rst @@ -0,0 +1,37 @@ +Enumeration resizeAlgorithm +=========================== + +.. rubric:: RESIZE_CUBIC + + + +.. code-block:: json + + RESIZE_CUBIC: number + +- Defined in + `addon.ts:160 `__ + + +.. rubric:: RESIZE_LINEAR + + + +.. code-block:: json + + RESIZE_LINEAR: number + +- Defined in + `addon.ts:161 `__ + + +.. rubric:: RESIZE_NEAREST + + + +.. code-block:: json + + RESIZE_NEAREST: number + +- Defined in + `addon.ts:159 `__ diff --git a/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/CompiledModel.rst b/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/CompiledModel.rst new file mode 100644 index 00000000000..4156012a67c --- /dev/null +++ b/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/CompiledModel.rst @@ -0,0 +1,107 @@ +Interface CompiledModel +======================= + +.. code-block:: json + + interface CompiledModel { +     inputs: Output[]; +     outputs: Output[]; +     createInferRequest(): InferRequest; +     input(nameOrId?): Output; +     output(nameOrId?): Output; + } + +- Defined in + `addon.ts:52 `__ + + +Properties +##################### + +.. rubric:: inputs + + + +.. code-block:: json + + inputs: Output [] + +- Defined in + `addon.ts:54 `__ + + + +.. rubric:: outputs + + + +.. code-block:: json + + outputs: Output [] + +- Defined in + `addon.ts:53 `__ + + + +Methods +##################### + +.. rubric:: createInferRequest + + +.. code-block:: json + + createInferRequest(): InferRequest + +**Returns** :doc:`InferRequest ` + +- Defined in + `addon.ts:57 `__ + + + +.. rubric:: input + + + +.. code-block:: json + + input(nameOrId?): Output + + +**Parameters** + +- ``Optional`` + + .. code-block:: json + + nameOrId: string|number + +**Returns** :doc:`InferRequest ` + +- Defined in + `addon.ts:56 `__ + + + +.. rubric:: output + + +.. code-block:: json + + output(nameOrId?): Output + +- ``Optional`` + + .. code-block:: json + + nameOrId: string|number + +**Returns** :doc:`Output ` + + + +- Defined in + `addon.ts:55 `__ + diff --git a/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/Core.rst b/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/Core.rst new file mode 100644 index 00000000000..152d88d0ba6 --- /dev/null +++ b/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/Core.rst @@ -0,0 +1,166 @@ +Interface Core +============== + +.. code-block:: json + + interface Core { +     compileModel(model, device, config?): Promise; +     compileModelSync(model, device, config?): CompiledModel; +     readModel(modelPath, weightsPath?): Promise; +     readModel(modelBuffer, weightsBuffer?): Promise; +     readModelSync(modelPath, weightsPath?): Model; +     readModelSync(modelBuffer, weightsBuffer?): Model; + }} + +- Defined in + `addon.ts:23 `__ + + +Methods +##################### + + +.. rubric:: compileModel + + +.. code-block:: json + + compileModel(model, device, config?): Promise + + +**Parameters** + + +- model: :doc:`Model ` +- device: string +- ``Optional`` + + .. code-block:: json + + config: { +     [option: string]: string; + } + + +- [option: string]:string + + +**Returns** Promise<\ :doc:`CompiledModel ` \> + +- Defined in + `addon.ts:24 `__ + + +.. rubric:: compileModelSync + + +.. code-block:: json + + compileModelSync(model, device, config?): CompiledModel + + +**Parameters** + +- model: :doc:`Model ` +- device: string +- ``Optional`` + + .. code-block:: json + + config: { +     [option: string]: string; + } + +- [option: string]:string + + +**Returns** :doc:`CompiledModel ` + + +- Defined in + `addon.ts:29 `__ + + +.. rubric:: readModel + + +.. code-block:: json + + readModel(modelPath, weightsPath?): Promise + + +**Parameters** + + - modelPath: string + - ``Optional`` + + .. code-block:: json + + weightsPath: string + + +**Returns** Promise<\ :doc:`Model `\ > + +- Defined in + `addon.ts:34 `__ + +.. code-block:: json + + readModel(modelBuffer, weightsBuffer?): Promise + +**Parameters** + +- modelBuffer: Uint8Array +- ``Optional`` + + .. code-block:: json + + weightsBuffer: Uint8Array + + +**Returns** Promise<\ :doc:`Model `\ > + + +- Defined in + `addon.ts:35 `__ + +.. rubric:: readModelSync + + +.. code-block:: json + + readModelSync(modelPath, weightsPath?): Model + + +**Parameters** + +- modelPath: string +- ``Optional`` + + .. code-block:: json + + weightsPath: string + +**Returns** :doc:`Model ` + +- Defined in + `addon.ts:37 `__ + +.. code-block:: json + + readModelSync(modelBuffer, weightsBuffer?): Model + + +**Parameters** + +- modelBuffer: Uint8Array +- ``Optional`` + + .. code-block:: json + + weightsBuffer: Uint8Array + +**Returns** :doc:`Model ` + +- Defined in + `addon.ts:38 `__ diff --git a/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/CoreConstructor.rst b/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/CoreConstructor.rst new file mode 100644 index 00000000000..4f8051a17e0 --- /dev/null +++ b/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/CoreConstructor.rst @@ -0,0 +1,23 @@ +Interface CoreConstructor +========================= + +.. code-block:: json + + interface CoreConstructor { + new Core(): Core; + } + +- Defined in + `addon.ts:40 `__ + +.. rubric:: constructor + +.. code-block:: json + + new Core(): Core + +**Returns** :doc:`Core ` + +- Defined in + `addon.ts:41 `__ + diff --git a/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/InferRequest.rst b/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/InferRequest.rst new file mode 100644 index 00000000000..1468c47d24d --- /dev/null +++ b/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/InferRequest.rst @@ -0,0 +1,227 @@ +InferRequest +============ + +.. rubric:: Interface InferRequest + + +.. code-block:: json + + interface InferRequest { + getCompiledModel(): CompiledModel; + getInputTensor(idx?): Tensor; + getOutputTensor(idx?): Tensor; + getTensor(nameOrOutput): Tensor; + infer(inputData?): { + [outputName: string]: Tensor; + }; + inferAsync(inputData): Promise<{ + [outputName: string]: Tensor; + }>; + setInputTensor(idxOrTensor, tensor?): void; + setOutputTensor(idxOrTensor, tensor?): void; + setTensor(name, tensor): void; + } + +- Defined in + `addon.ts:72 `__ + +Methods +##################### + + +.. rubric:: getCompiledModel + +.. code-block:: json + + getCompiledModel(): CompiledModel + +**Returns** :doc:`CompiledModel ` + +- Defined in + `addon.ts:83 `__ + + +.. rubric:: getInputTensor + +.. code-block:: json + + getInputTensor(idx?): Tensor + + +**Parameters** + +- ``Optional`` + + .. code-block:: json + + idx: number + + +**Returns** :doc:`Tensor ` + +- Defined in + `addon.ts:77 `__ + +.. rubric:: getOutputTensor + +.. code-block:: json + + getOutputTensor(idx?): Tensor + + +**Parameters** + +- ``Optional`` + + .. code-block:: json + + idx: number + +**Returns** :doc:`Tensor ` + + +- Defined in + `addon.ts:78 `__ + +.. rubric:: getTensor + +.. code-block:: json + + getTensor(nameOrOutput): Tensor + +**Parameters** + +- nameOrOutput: string| :doc:`Output ` + +**Returns** :doc:`Tensor ` + +- Defined in + `addon.ts:76 `__ + +.. rubric:: infer + + +.. code-block:: json + + infer(inputData?): { + [outputName: string]: Tensor; + } + + +**Parameters** + +- ``Optional`` + + .. code-block:: json + + inputData: { + [inputName: string]: Tensor | SupportedTypedArray; + } | Tensor[] | SupportedTypedArray[] + +**Returns** + +.. code-block:: json + + { + [outputName: string]: Tensor; + } + +- [outputName: string]: Tensor + + +- Defined in + `addon.ts:79 `__ + +.. rubric:: inferAsync + + +.. code-block:: json + + inferAsync(inputData): Promise<{ + [outputName: string]: Tensor; + }> + +**Parameters** + +- + + .. code-block:: json + + inputData: Tensor[] | { + [inputName: string]: Tensor; + } + +**Returns** + +.. code-block:: json + + Promise<{ + [outputName: string]: Tensor; + }> + + +- Defined in + `addon.ts:81 `__ + +.. rubric:: setInputTensor + +.. code-block:: json + + setInputTensor(idxOrTensor, tensor?): void + + +**Parameters** + +- idxOrTensor: number| :doc:`Tensor ` + +- ``Optional`` + + .. code-block:: json + + tensor: Tensor + + +**Returns** void + +- Defined in + `addon.ts:74 `__ + +.. rubric:: setOutputTensor + + +.. code-block:: json + + setOutputTensor(idxOrTensor, tensor?): void + + +**Parameters** + +- idxOrTensor: number| :doc:`Tensor ` +- ``Optional`` + + .. code-block:: json + + tensor: Tensor + + +**Returns** void + +- Defined in + `addon.ts:75 `__ + +.. rubric:: setTensor + + +.. code-block:: json + + setTensor(name, tensor): void + +**Parameters** + +- name: string +- tensor: :doc:`Tensor ` + +**Returns** void + +- Defined in + `addon.ts:73 `__ diff --git a/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/InputInfo.rst b/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/InputInfo.rst new file mode 100644 index 00000000000..0262d3b17ef --- /dev/null +++ b/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/InputInfo.rst @@ -0,0 +1,56 @@ +Interface InputInfo +=================== + +.. code-block:: json + + interface InputInfo { + model(): InputModelInfo; + preprocess(): PreProcessSteps; + tensor(): InputTensorInfo; + } + +- Defined in + `addon.ts:116 `__ + +Methods +##################### + +.. rubric:: model + + + +.. code-block:: json + + model(): InputModelInfo + +**Returns** :doc:`InputModelInfo ` + +- Defined in + `addon.ts:119 `__ + + +.. rubric:: preprocess + + +.. code-block:: json + + preprocess(): PreProcessSteps + +**Returns** :doc:`PreProcessSteps ` + +- Defined in + `addon.ts:118 `__ + + +.. rubric:: tensor + + +.. code-block:: json + + tensor(): InputTensorInfo + + +**Returns** :doc:`InputTensorInfo ` + +- Defined in + `addon.ts:117 `__ diff --git a/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/InputModelInfo.rst b/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/InputModelInfo.rst new file mode 100644 index 00000000000..2a17dcc7840 --- /dev/null +++ b/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/InputModelInfo.rst @@ -0,0 +1,32 @@ +Interface InputModelInfo +======================== + + +.. code-block:: json + + interface InputModelInfo { + setLayout(layout): InputModelInfo; + } + +- Defined in + `addon.ts:112 `__ + +Methods +##################### + +.. rubric:: setLayout + + + +.. code-block:: json + + setLayout(layout): InputModelInfo + +**Parameters** + +- layout: string + +**Returns** :doc:`InputModelInfo ` + +- Defined in + `addon.ts:113 `__ diff --git a/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/InputTensorInfo.rst b/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/InputTensorInfo.rst new file mode 100644 index 00000000000..4d3d8e0c0be --- /dev/null +++ b/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/InputTensorInfo.rst @@ -0,0 +1,74 @@ +Interface InputTensorInfo +========================= + + +.. code-block:: json + + interface InputTensorInfo { + setElementType(elementType): InputTensorInfo; + setLayout(layout): InputTensorInfo; + setShape(shape): InputTensorInfo; + } + +- Defined in + `addon.ts:98 `__ + +Methods +##################### + +.. rubric:: setElementType + + + +.. code-block:: json + + setElementType(elementType): InputTensorInfo + +**Parameters** + + +- elementType: :doc:`elementTypeString <../types/elementTypeString>` | :doc:`element <../enums/element>` + +**Returns** :doc:`InputTensorInfo ` + + + +- Defined in + `addon.ts:99 `__ + + + +.. rubric:: setLayout + + + +.. code-block:: json + + setLayout(layout): InputTensorInfo + +**Parameters** + +- layout: string + + +**Returns** :doc:`InputTensorInfo ` + +- Defined in + `addon.ts:100 `__ + +.. rubric:: setShape + + +.. code-block:: json + + setShape(shape): InputTensorInfo + + +**Parameters** + +- shape: number[] + +**Returns** :doc:`InputTensorInfo ` + +- Defined in + `addon.ts:101 `__ diff --git a/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/Model.rst b/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/Model.rst new file mode 100644 index 00000000000..c7e96a6b4cc --- /dev/null +++ b/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/Model.rst @@ -0,0 +1,110 @@ +Interface Model +=============== + +.. rubric:: Interface Model + + +.. code-block:: json + + interface Model { + inputs: Output[]; + outputs: Output[]; + getName(): string; + input(nameOrId?): Output; + output(nameOrId?): Output; + } + +- Defined in + `addon.ts:44 `__ + + +Properties +##################### + + +.. rubric:: inputs + + + +.. code-block:: json + + inputs: Output[] + +- Defined in + `addon.ts:46 `__ + +.. rubric:: outputs + + + +.. code-block:: json + + outputs: Output[] + +- Defined in + `addon.ts:45 `__ + + +Methods +##################### + + +.. rubric:: getName + + +.. code-block:: json + + getName(): string + + +**Returns** string + +- Defined in + `addon.ts:49 `__ + + +.. rubric:: input + + +.. code-block:: json + + input(nameOrId?): Output + + +**Parameters** + + +- ``Optional`` + + .. code-block:: json + + nameOrId: string|number + + +**Returns** :doc:`Output ` + + +- Defined in + `addon.ts:48 `__ + + +.. rubric:: output + + +.. code-block:: json + + output(nameOrId?): Output + + +**Parameters** + +- ``Optional`` + + .. code-block:: json + + nameOrId: string|number + +**Returns** :doc:`Output ` + +- Defined in + `addon.ts:47 `__ diff --git a/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/Output.rst b/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/Output.rst new file mode 100644 index 00000000000..6f7f59ef3b3 --- /dev/null +++ b/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/Output.rst @@ -0,0 +1,107 @@ +Interface Output +================ + + +.. code-block:: json + + interface Output { + anyName: string; + shape: number[]; + getAnyName(): string; + getPartialShape(): PartialShape; + getShape(): number[]; + toString(): string; + } + +- Defined in + `addon.ts:89 `__ + +Properties +##################### + +.. rubric:: anyName + + + +.. code-block:: json + + anyName: string + +- Defined in + `addon.ts:90 `__ + + + +.. rubric:: shape + + + +.. code-block:: json + + shape: number[] + +- Defined in + `addon.ts:91 `__ + + + +Methods +##################### + +.. rubric:: getAnyName + + +.. code-block:: json + + getAnyName(): string + + +**Returns** string + +- Defined in + `addon.ts:93 `__ + +.. rubric:: getPartialShape + + +.. code-block:: json + + getPartialShape(): PartialShape + + +**Returns** :doc:`PartialShape ` + +- Defined in + `addon.ts:95 `__ + +.. rubric:: getShape + + +.. code-block:: json + + getShape(): number[] + +**Returns** + +.. code-block:: json + + number[] + +- Defined in + `addon.ts:94 `__ + +.. rubric:: toString + + +.. code-block:: json + + toString(): string + +**Returns** + +.. code-block:: json + + string + +- Defined in + `addon.ts:92 `__ diff --git a/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/OutputInfo.rst b/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/OutputInfo.rst new file mode 100644 index 00000000000..90f5780942b --- /dev/null +++ b/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/OutputInfo.rst @@ -0,0 +1,28 @@ +Interface OutputInfo +==================== + +.. code-block:: json + + interfaceOutputInfo { +     tensor(): OutputTensorInfo; + } + +- Defined in + `addon.ts:122 `__ + + +Methods +##################### + + +.. rubric:: tensor + + +.. code-block:: json + + tensor(): OutputTensorInfo + +**Returns** :doc:`OutputTensorInfo ` + +- Defined in + `addon.ts:123 `__ diff --git a/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/OutputTensorInfo.rst b/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/OutputTensorInfo.rst new file mode 100644 index 00000000000..d1187a0aec0 --- /dev/null +++ b/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/OutputTensorInfo.rst @@ -0,0 +1,48 @@ +Interface OutputTensorInfo +========================== + +.. code-block:: json + + interface OutputTensorInfo { + setElementType(elementType): InputTensorInfo; + setLayout(layout): InputTensorInfo; + } + +- Defined in + `addon.ts:104 `__ + +Methods +##################### + +.. rubric:: setElementType + + +.. code-block:: json + + setElementType(elementType): InputTensorInfo + +**Parameters** + +- elementType: elementTypeString | element + +**Returns** :doc:`InputTensorInfo ` + +- Defined in + `addon.ts:105 `__ + +.. rubric:: setLayout + + +.. code-block:: json + + setLayout(layout): InputTensorInfo + + +**Parameters** + +- layout: string + +**Returns** :doc:`InputTensorInfo ` + +- Defined in + `addon.ts:106 `__ diff --git a/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/PartialShape.rst b/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/PartialShape.rst new file mode 100644 index 00000000000..39446bb3438 --- /dev/null +++ b/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/PartialShape.rst @@ -0,0 +1,72 @@ +Interface PartialShape +====================== + +.. code-block:: json + + interface PartialShape { + getDimensions(): Dimension[]; + isDynamic(): boolean; + isStatic(): boolean; + toString(): string; + } + +- Defined in + `addon.ts:135 `__ + +Methods +##################### + +.. rubric:: getDimensions + + +.. code-block:: json + + getDimensions(): Dimension + + +**Returns** :doc:`Dimension <../types/Dimension>` [] + +- Defined in + `addon.ts:139 `__ + +.. rubric:: isDynamic + + +.. code-block:: json + + isDynamic(): boolean + + +**Returns** boolean + +- Defined in + `addon.ts:137 `__ + +.. rubric:: isStatic + + + +.. code-block:: json + + isStatic(): boolean + + +**Returns** boolean + + +- Defined in + `addon.ts:136 `__ + +.. rubric:: toString + + +.. code-block:: json + + toString(): string + + +**Returns** string + +- Defined in + `addon.ts:138 `__ + diff --git a/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/PartialShapeConstructor.rst b/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/PartialShapeConstructor.rst new file mode 100644 index 00000000000..2b1645dc857 --- /dev/null +++ b/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/PartialShapeConstructor.rst @@ -0,0 +1,31 @@ +Interface PartialShapeConstructor +================================= + +.. code-block:: json + + interface PartialShapeConstructor { + new PartialShape(shape): PartialShape; + } + +- Defined in + `addon.ts:141 `__ + + +.. rubric:: constructor + + + +.. code-block:: json + + new PartialShape(shape): PartialShape + + +**Parameters** + +- shape: string + +**Returns** :doc:`PartialShape ` + +- Defined in + `addon.ts:142 `__ + diff --git a/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/PrePostProcessor.rst b/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/PrePostProcessor.rst new file mode 100644 index 00000000000..cb1a8f49ae9 --- /dev/null +++ b/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/PrePostProcessor.rst @@ -0,0 +1,73 @@ +Interface PrePostProcessor +========================== + +.. code-block:: json + + interface PrePostProcessor { + build(): PrePostProcessor; + input(idxOrTensorName?): InputInfo; + output(idxOrTensorName?): OutputInfo; + } + +- Defined in + `addon.ts:126 `__ + +Methods +##################### + +.. rubric:: build + + +.. code-block:: json + + build(): PrePostProcessor + +**Returns** :doc: `PrePostProcessor ` + +- Defined in + `addon.ts:127 `__ + +.. rubric:: input + + + +.. code-block:: json + + input(idxOrTensorName?): InputInfo + +**Parameters** + + +- ``Optional`` + +.. code-block:: json + + idxOrTensorName: string|number + + +**Returns** :doc:`InputInfo ` + +- Defined in + `addon.ts:128 `__ + +.. rubric:: output + + +.. code-block:: json + + output(idxOrTensorName?): OutputInfo + + +**Parameters** + +- ``Optional`` + + .. code-block:: json + + idxOrTensorName: string|number + + +**Returns** :doc:`OutputInfo ` + +- Defined in + `addon.ts:129 `__ diff --git a/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/PrePostProcessorConstructor.rst b/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/PrePostProcessorConstructor.rst new file mode 100644 index 00000000000..3d7ea4424df --- /dev/null +++ b/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/PrePostProcessorConstructor.rst @@ -0,0 +1,30 @@ +Interface PrePostProcessorConstructor +===================================== + + +.. code-block:: json + + interface PrePostProcessorConstructor { + new PrePostProcessor(model): PrePostProcessor; + } + +- Defined in + `addon.ts:131 `__ + +.. rubric:: constructor + + +.. code-block:: json + + new PrePostProcessor(model): PrePostProcessor + +**Parameters** + +- model: :doc:`Model ` + + +**Returns** :doc:`PrePostProcessor ` + +- Defined in + `addon.ts:132 `__ + diff --git a/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/PreProcessSteps.rst b/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/PreProcessSteps.rst new file mode 100644 index 00000000000..c519210ea65 --- /dev/null +++ b/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/PreProcessSteps.rst @@ -0,0 +1,32 @@ +Interface PreProcessSteps +========================= + + +.. code-block:: json + + interface PreProcessSteps { + resize(algorithm): PreProcessSteps; + } + +- Defined in + `addon.ts:108 `__ + +Methods +##################### + +.. rubric:: resize + + +.. code-block:: json + + resize(algorithm): PreProcessSteps + +**Parameters** + + +- algorithm: string| :doc:`resizeAlgorithm <../enums/resizeAlgorithm>` + +**Returns** :doc:`PreProcessSteps ` + +- Defined in + `addon.ts:109 `__ diff --git a/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/Tensor.rst b/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/Tensor.rst new file mode 100644 index 00000000000..ea04031e8cc --- /dev/null +++ b/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/Tensor.rst @@ -0,0 +1,75 @@ +Interface Tensor +===================== + +.. rubric:: Interface Tensor + + +.. code-block:: json + + interface Tensor { + data: number[]; + getData(): number[]; + getElementType(): element; + getShape(): number[]; + } + +- Defined in + `addon.ts:60 `__ + +Properties +##################### + +.. rubric:: data + + + +.. code-block:: json + + data: number[] + +- Defined in + `addon.ts:61 `__ + + + +Methods +##################### + +.. rubric:: getData + + +.. code-block:: json + + getData(): number[] + + +**Returns** number[] + + +- Defined in + `addon.ts:64 `__ + +.. rubric:: getElementType + + +.. code-block:: json + + getElementType(): element + + +**Returns** :doc:`element <../enums/element>` + +- Defined in + `addon.ts:62 `__ + +.. rubric:: getShape + +.. code-block:: json + + getShape(): number[] + + +**Returns** number[] + +- Defined in + `addon.ts:63 `__ diff --git a/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/TensorConstructor.rst b/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/TensorConstructor.rst new file mode 100644 index 00000000000..5bf387b3bdf --- /dev/null +++ b/docs/sphinx_setup/api/nodejs_api/openvino-node/interfaces/TensorConstructor.rst @@ -0,0 +1,38 @@ +Interface TensorConstructor +=========================== + +.. rubric:: Interface TensorConstructor + + +.. code-block:: json + + interface TensorConstructor { + new Tensor(type, shape, tensorData?): Tensor; + } + +- Defined in + `addon.ts:66 `__ + +.. rubric:: constructor + + + +.. code-block:: json + + new Tensor(type, shape, tensorData?): Tensor + +**Parameters** + +- type: :doc:`elementTypeString <../types/elementTypeString>` | :doc:`element <../enums/element>` +- shape: number[] +- ``Optional`` + + .. code-block:: json + + tensorData: number[]|SupportedTypedArray + + +**Returns** :doc:`Tensor ` + +- Defined in + `addon.ts:67 `__ diff --git a/docs/sphinx_setup/api/nodejs_api/openvino-node/types/Dimension.rst b/docs/sphinx_setup/api/nodejs_api/openvino-node/types/Dimension.rst new file mode 100644 index 00000000000..19fefc2922b --- /dev/null +++ b/docs/sphinx_setup/api/nodejs_api/openvino-node/types/Dimension.rst @@ -0,0 +1,9 @@ +Type alias Dimension +==================== + +.. code-block:: json + + Dimension: number|[number,number] + +- Defined in + `addon.ts:87 `__ diff --git a/docs/sphinx_setup/api/nodejs_api/openvino-node/types/SupportedTypedArray.rst b/docs/sphinx_setup/api/nodejs_api/openvino-node/types/SupportedTypedArray.rst new file mode 100644 index 00000000000..e097f90f83a --- /dev/null +++ b/docs/sphinx_setup/api/nodejs_api/openvino-node/types/SupportedTypedArray.rst @@ -0,0 +1,11 @@ +Type alias SupportedTypedArray +============================== + + +.. code-block:: json + + SupportedTypedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array + +- Defined in + `addon.ts:1 `__ + diff --git a/docs/sphinx_setup/api/nodejs_api/openvino-node/types/elementTypeString.rst b/docs/sphinx_setup/api/nodejs_api/openvino-node/types/elementTypeString.rst new file mode 100644 index 00000000000..e83e9a183b4 --- /dev/null +++ b/docs/sphinx_setup/api/nodejs_api/openvino-node/types/elementTypeString.rst @@ -0,0 +1,9 @@ +Type alias elementTypeString +============================ + +.. code-block:: json + + elementTypeString: "u8" | "u32" | "u16" | "u64" | "i8" | "i64" | "i32" | "i16" | "f64" | "f32" + +- Defined in + `addon.ts:11 `__