[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
This commit is contained in:
Sebastian Golebiewski 2024-03-12 09:03:02 +01:00 committed by GitHub
parent 8c58b05c01
commit 21bf6ab80b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
26 changed files with 1672 additions and 174 deletions

View File

@ -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 <nodejs_api/nodejs_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.

View File

@ -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 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L164>`__
Properties
#####################
.. rubric:: Core
.. code-block:: json
Core: CoreConstructor
.. rubric:: Type declaration
- CoreConstructor: :doc:`CoreConstructor <./openvino-node/interfaces/CoreConstructor>`
- Defined in
`addon.ts:165 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L165>`__
.. rubric:: PartialShape
.. code-block:: json
PartialShape: PartialShapeConstructor
.. rubric:: Type declaration
- PartialShapeConstructor: :doc:`PartialShapeConstructor <./openvino-node/interfaces/PartialShapeConstructor>`
- Defined in
`addon.ts:167 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L167>`__
.. rubric:: Tensor
.. code-block:: json
Tensor: TensorConstructor
.. rubric:: Type declaration
- TensorConstructor: :doc:`TensorConstructor <./openvino-node/interfaces/TensorConstructor>`
- Defined in
`addon.ts:166 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L166>`__
.. rubric:: element
.. code-block:: json
element: typeof element
.. rubric:: Type declaration
- element:typeof :doc:`element <./openvino-node/enums/element>`
- Defined in
`addon.ts:173 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L173>`__
.. 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 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L169>`__

View File

@ -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 <https://github.com/openvinotoolkit/openvino/blob/master/samples/js/node/hello_classification/hello_classification.js>`__
- `Hello Reshape SSD Sample <https://github.com/openvinotoolkit/openvino/blob/master/samples/js/node/hello_reshape_ssd/hello_reshape_ssd.js>`__
- `Image Classification Async Sample <https://github.com/openvinotoolkit/openvino/blob/master/samples/js/node/classification_sample_async/classification_sample_async.js>`__
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<CompiledModel>
compileModelSync(model: Model, device: string, config?: { [option: string]: string }): CompiledModel
readModel(modelPath: string, binPath?: string): Promise<Model>
readModel(modelBuffer: Uint8Array, weightsBuffer?: Uint8Array): Promise<Model>;
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
<https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/docs/README.md#openvino-node-package-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 <https://github.com/openvinotoolkit/openvino/blob/master/samples/js/node/README.md>`__
- `OpenVINO™ Core Components <https://github.com/openvinotoolkit/openvino/blob/master/src/README.md>`__
- `OpenVINO™ Python API <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/python/README.md>`__
- `OpenVINO™ Other Bindings <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/README.md>`__

View File

@ -0,0 +1,119 @@
Enumeration element
===================
.. rubric:: f32
.. code-block:: json
f32: number
- Defined in
`addon.ts:154 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L154>`__
.. rubric:: f64
.. code-block:: json
f64: number
- Defined in
`addon.ts:155 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L155>`__
.. rubric:: i16
.. code-block:: json
i16: number
- Defined in
`addon.ts:151 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L151>`__
.. rubric:: i32
.. code-block:: json
i32: number
- Defined in
`addon.ts:152 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L152>`__
.. rubric:: i64
.. code-block:: json
i64: number
- Defined in
`addon.ts:153 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L153>`__
.. rubric:: i8
.. code-block:: json
i8: number
- Defined in
`addon.ts:150 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L150>`__
.. rubric:: u16
.. code-block:: json
u16: number
- Defined in
`addon.ts:148 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L148>`__
.. rubric:: u32
.. code-block:: json
u32: number
- Defined in
`addon.ts:147 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L147>`__
.. rubric:: u64
.. code-block:: json
u64: number
- Defined in
`addon.ts:149 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L149>`__
.. rubric:: u8
.. code-block:: json
u8: number
- Defined in
`addon.ts:146 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L146>`__

View File

@ -0,0 +1,37 @@
Enumeration resizeAlgorithm
===========================
.. rubric:: RESIZE_CUBIC
.. code-block:: json
RESIZE_CUBIC: number
- Defined in
`addon.ts:160 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L160>`__
.. rubric:: RESIZE_LINEAR
.. code-block:: json
RESIZE_LINEAR: number
- Defined in
`addon.ts:161 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L161>`__
.. rubric:: RESIZE_NEAREST
.. code-block:: json
RESIZE_NEAREST: number
- Defined in
`addon.ts:159 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L159>`__

View File

@ -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 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L52>`__
Properties
#####################
.. rubric:: inputs
.. code-block:: json
inputs: Output []
- Defined in
`addon.ts:54 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L54>`__
.. rubric:: outputs
.. code-block:: json
outputs: Output []
- Defined in
`addon.ts:53 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L53>`__
Methods
#####################
.. rubric:: createInferRequest
.. code-block:: json
createInferRequest(): InferRequest
**Returns** :doc:`InferRequest <InferRequest>`
- Defined in
`addon.ts:57 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L57>`__
.. rubric:: input
.. code-block:: json
input(nameOrId?): Output
**Parameters**
- ``Optional``
.. code-block:: json
nameOrId: string|number
**Returns** :doc:`InferRequest <Output>`
- Defined in
`addon.ts:56 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L56>`__
.. rubric:: output
.. code-block:: json
output(nameOrId?): Output
- ``Optional``
.. code-block:: json
nameOrId: string|number
**Returns** :doc:`Output <Output>`
- Defined in
`addon.ts:55 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L55>`__

View File

@ -0,0 +1,166 @@
Interface Core
==============
.. code-block:: json
interface Core {
    compileModel(model, device, config?): Promise<CompiledModel>;
    compileModelSync(model, device, config?): CompiledModel;
    readModel(modelPath, weightsPath?): Promise<Model>;
    readModel(modelBuffer, weightsBuffer?): Promise<Model>;
    readModelSync(modelPath, weightsPath?): Model;
    readModelSync(modelBuffer, weightsBuffer?): Model;
}}
- Defined in
`addon.ts:23 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L23>`__
Methods
#####################
.. rubric:: compileModel
.. code-block:: json
compileModel(model, device, config?): Promise<CompiledModel>
**Parameters**
- model: :doc:`Model <Model>`
- device: string
- ``Optional``
.. code-block:: json
config: {
    [option: string]: string;
}
- [option: string]:string
**Returns** Promise<\ :doc:`CompiledModel <CompiledModel>` \>
- Defined in
`addon.ts:24 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L24>`__
.. rubric:: compileModelSync
.. code-block:: json
compileModelSync(model, device, config?): CompiledModel
**Parameters**
- model: :doc:`Model <Model>`
- device: string
- ``Optional``
.. code-block:: json
config: {
    [option: string]: string;
}
- [option: string]:string
**Returns** :doc:`CompiledModel <CompiledModel>`
- Defined in
`addon.ts:29 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L29>`__
.. rubric:: readModel
.. code-block:: json
readModel(modelPath, weightsPath?): Promise<Model>
**Parameters**
- modelPath: string
- ``Optional``
.. code-block:: json
weightsPath: string
**Returns** Promise<\ :doc:`Model <Model>`\ >
- Defined in
`addon.ts:34 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L34>`__
.. code-block:: json
readModel(modelBuffer, weightsBuffer?): Promise<Model>
**Parameters**
- modelBuffer: Uint8Array
- ``Optional``
.. code-block:: json
weightsBuffer: Uint8Array
**Returns** Promise<\ :doc:`Model <Model>`\ >
- Defined in
`addon.ts:35 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L35>`__
.. rubric:: readModelSync
.. code-block:: json
readModelSync(modelPath, weightsPath?): Model
**Parameters**
- modelPath: string
- ``Optional``
.. code-block:: json
weightsPath: string
**Returns** :doc:`Model <Model>`
- Defined in
`addon.ts:37 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L37>`__
.. code-block:: json
readModelSync(modelBuffer, weightsBuffer?): Model
**Parameters**
- modelBuffer: Uint8Array
- ``Optional``
.. code-block:: json
weightsBuffer: Uint8Array
**Returns** :doc:`Model <Model>`
- Defined in
`addon.ts:38 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L38>`__

View File

@ -0,0 +1,23 @@
Interface CoreConstructor
=========================
.. code-block:: json
interface CoreConstructor {
new Core(): Core;
}
- Defined in
`addon.ts:40 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L40>`__
.. rubric:: constructor
.. code-block:: json
new Core(): Core
**Returns** :doc:`Core <Core>`
- Defined in
`addon.ts:41 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L41>`__

View File

@ -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 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L72>`__
Methods
#####################
.. rubric:: getCompiledModel
.. code-block:: json
getCompiledModel(): CompiledModel
**Returns** :doc:`CompiledModel <CompiledModel>`
- Defined in
`addon.ts:83 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L83>`__
.. rubric:: getInputTensor
.. code-block:: json
getInputTensor(idx?): Tensor
**Parameters**
- ``Optional``
.. code-block:: json
idx: number
**Returns** :doc:`Tensor <Tensor>`
- Defined in
`addon.ts:77 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L77>`__
.. rubric:: getOutputTensor
.. code-block:: json
getOutputTensor(idx?): Tensor
**Parameters**
- ``Optional``
.. code-block:: json
idx: number
**Returns** :doc:`Tensor <Tensor>`
- Defined in
`addon.ts:78 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L78>`__
.. rubric:: getTensor
.. code-block:: json
getTensor(nameOrOutput): Tensor
**Parameters**
- nameOrOutput: string| :doc:`Output <Output>`
**Returns** :doc:`Tensor <Tensor>`
- Defined in
`addon.ts:76 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L76>`__
.. 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 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L79>`__
.. 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 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L81>`__
.. rubric:: setInputTensor
.. code-block:: json
setInputTensor(idxOrTensor, tensor?): void
**Parameters**
- idxOrTensor: number| :doc:`Tensor <Tensor>`
- ``Optional``
.. code-block:: json
tensor: Tensor
**Returns** void
- Defined in
`addon.ts:74 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L74>`__
.. rubric:: setOutputTensor
.. code-block:: json
setOutputTensor(idxOrTensor, tensor?): void
**Parameters**
- idxOrTensor: number| :doc:`Tensor <Tensor>`
- ``Optional``
.. code-block:: json
tensor: Tensor
**Returns** void
- Defined in
`addon.ts:75 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L75>`__
.. rubric:: setTensor
.. code-block:: json
setTensor(name, tensor): void
**Parameters**
- name: string
- tensor: :doc:`Tensor <Tensor>`
**Returns** void
- Defined in
`addon.ts:73 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L73>`__

View File

@ -0,0 +1,56 @@
Interface InputInfo
===================
.. code-block:: json
interface InputInfo {
model(): InputModelInfo;
preprocess(): PreProcessSteps;
tensor(): InputTensorInfo;
}
- Defined in
`addon.ts:116 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L116>`__
Methods
#####################
.. rubric:: model
.. code-block:: json
model(): InputModelInfo
**Returns** :doc:`InputModelInfo <InputModelInfo>`
- Defined in
`addon.ts:119 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L119>`__
.. rubric:: preprocess
.. code-block:: json
preprocess(): PreProcessSteps
**Returns** :doc:`PreProcessSteps <PreProcessSteps>`
- Defined in
`addon.ts:118 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L118>`__
.. rubric:: tensor
.. code-block:: json
tensor(): InputTensorInfo
**Returns** :doc:`InputTensorInfo <InputTensorInfo>`
- Defined in
`addon.ts:117 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L117>`__

View File

@ -0,0 +1,32 @@
Interface InputModelInfo
========================
.. code-block:: json
interface InputModelInfo {
setLayout(layout): InputModelInfo;
}
- Defined in
`addon.ts:112 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L112>`__
Methods
#####################
.. rubric:: setLayout
.. code-block:: json
setLayout(layout): InputModelInfo
**Parameters**
- layout: string
**Returns** :doc:`InputModelInfo <InputModelInfo>`
- Defined in
`addon.ts:113 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L113>`__

View File

@ -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 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L98>`__
Methods
#####################
.. rubric:: setElementType
.. code-block:: json
setElementType(elementType): InputTensorInfo
**Parameters**
- elementType: :doc:`elementTypeString <../types/elementTypeString>` | :doc:`element <../enums/element>`
**Returns** :doc:`InputTensorInfo <InputTensorInfo>`
- Defined in
`addon.ts:99 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L99>`__
.. rubric:: setLayout
.. code-block:: json
setLayout(layout): InputTensorInfo
**Parameters**
- layout: string
**Returns** :doc:`InputTensorInfo <InputTensorInfo>`
- Defined in
`addon.ts:100 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L100>`__
.. rubric:: setShape
.. code-block:: json
setShape(shape): InputTensorInfo
**Parameters**
- shape: number[]
**Returns** :doc:`InputTensorInfo <InputTensorInfo>`
- Defined in
`addon.ts:101 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L101>`__

View File

@ -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 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L44>`__
Properties
#####################
.. rubric:: inputs
.. code-block:: json
inputs: Output[]
- Defined in
`addon.ts:46 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L46>`__
.. rubric:: outputs
.. code-block:: json
outputs: Output[]
- Defined in
`addon.ts:45 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L45>`__
Methods
#####################
.. rubric:: getName
.. code-block:: json
getName(): string
**Returns** string
- Defined in
`addon.ts:49 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L49>`__
.. rubric:: input
.. code-block:: json
input(nameOrId?): Output
**Parameters**
- ``Optional``
.. code-block:: json
nameOrId: string|number
**Returns** :doc:`Output <Output>`
- Defined in
`addon.ts:48 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L48>`__
.. rubric:: output
.. code-block:: json
output(nameOrId?): Output
**Parameters**
- ``Optional``
.. code-block:: json
nameOrId: string|number
**Returns** :doc:`Output <Output>`
- Defined in
`addon.ts:47 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L47>`__

View File

@ -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 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L89>`__
Properties
#####################
.. rubric:: anyName
.. code-block:: json
anyName: string
- Defined in
`addon.ts:90 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L90>`__
.. rubric:: shape
.. code-block:: json
shape: number[]
- Defined in
`addon.ts:91 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L91>`__
Methods
#####################
.. rubric:: getAnyName
.. code-block:: json
getAnyName(): string
**Returns** string
- Defined in
`addon.ts:93 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L93>`__
.. rubric:: getPartialShape
.. code-block:: json
getPartialShape(): PartialShape
**Returns** :doc:`PartialShape <PartialShape>`
- Defined in
`addon.ts:95 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L95>`__
.. rubric:: getShape
.. code-block:: json
getShape(): number[]
**Returns**
.. code-block:: json
number[]
- Defined in
`addon.ts:94 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L94>`__
.. rubric:: toString
.. code-block:: json
toString(): string
**Returns**
.. code-block:: json
string
- Defined in
`addon.ts:92 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L92>`__

View File

@ -0,0 +1,28 @@
Interface OutputInfo
====================
.. code-block:: json
interfaceOutputInfo {
    tensor(): OutputTensorInfo;
}
- Defined in
`addon.ts:122 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L122>`__
Methods
#####################
.. rubric:: tensor
.. code-block:: json
tensor(): OutputTensorInfo
**Returns** :doc:`OutputTensorInfo <OutputTensorInfo>`
- Defined in
`addon.ts:123 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L123>`__

View File

@ -0,0 +1,48 @@
Interface OutputTensorInfo
==========================
.. code-block:: json
interface OutputTensorInfo {
setElementType(elementType): InputTensorInfo;
setLayout(layout): InputTensorInfo;
}
- Defined in
`addon.ts:104 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L104>`__
Methods
#####################
.. rubric:: setElementType
.. code-block:: json
setElementType(elementType): InputTensorInfo
**Parameters**
- elementType: elementTypeString | element
**Returns** :doc:`InputTensorInfo <InputTensorInfo>`
- Defined in
`addon.ts:105 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L105>`__
.. rubric:: setLayout
.. code-block:: json
setLayout(layout): InputTensorInfo
**Parameters**
- layout: string
**Returns** :doc:`InputTensorInfo <InputTensorInfo>`
- Defined in
`addon.ts:106 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L106>`__

View File

@ -0,0 +1,72 @@
Interface PartialShape
======================
.. code-block:: json
interface PartialShape {
getDimensions(): Dimension[];
isDynamic(): boolean;
isStatic(): boolean;
toString(): string;
}
- Defined in
`addon.ts:135 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L135>`__
Methods
#####################
.. rubric:: getDimensions
.. code-block:: json
getDimensions(): Dimension
**Returns** :doc:`Dimension <../types/Dimension>` []
- Defined in
`addon.ts:139 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L139>`__
.. rubric:: isDynamic
.. code-block:: json
isDynamic(): boolean
**Returns** boolean
- Defined in
`addon.ts:137 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L137>`__
.. rubric:: isStatic
.. code-block:: json
isStatic(): boolean
**Returns** boolean
- Defined in
`addon.ts:136 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L136>`__
.. rubric:: toString
.. code-block:: json
toString(): string
**Returns** string
- Defined in
`addon.ts:138 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L138>`__

View File

@ -0,0 +1,31 @@
Interface PartialShapeConstructor
=================================
.. code-block:: json
interface PartialShapeConstructor {
new PartialShape(shape): PartialShape;
}
- Defined in
`addon.ts:141 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L141>`__
.. rubric:: constructor
.. code-block:: json
new PartialShape(shape): PartialShape
**Parameters**
- shape: string
**Returns** :doc:`PartialShape <PartialShape>`
- Defined in
`addon.ts:142 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L142>`__

View File

@ -0,0 +1,73 @@
Interface PrePostProcessor
==========================
.. code-block:: json
interface PrePostProcessor {
build(): PrePostProcessor;
input(idxOrTensorName?): InputInfo;
output(idxOrTensorName?): OutputInfo;
}
- Defined in
`addon.ts:126 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L126>`__
Methods
#####################
.. rubric:: build
.. code-block:: json
build(): PrePostProcessor
**Returns** :doc: `PrePostProcessor <PrePostProcessor>`
- Defined in
`addon.ts:127 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L127>`__
.. rubric:: input
.. code-block:: json
input(idxOrTensorName?): InputInfo
**Parameters**
- ``Optional``
.. code-block:: json
idxOrTensorName: string|number
**Returns** :doc:`InputInfo <InputInfo>`
- Defined in
`addon.ts:128 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L128>`__
.. rubric:: output
.. code-block:: json
output(idxOrTensorName?): OutputInfo
**Parameters**
- ``Optional``
.. code-block:: json
idxOrTensorName: string|number
**Returns** :doc:`OutputInfo <OutputInfo>`
- Defined in
`addon.ts:129 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L129>`__

View File

@ -0,0 +1,30 @@
Interface PrePostProcessorConstructor
=====================================
.. code-block:: json
interface PrePostProcessorConstructor {
new PrePostProcessor(model): PrePostProcessor;
}
- Defined in
`addon.ts:131 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L131>`__
.. rubric:: constructor
.. code-block:: json
new PrePostProcessor(model): PrePostProcessor
**Parameters**
- model: :doc:`Model <Model>`
**Returns** :doc:`PrePostProcessor <PrePostProcessor>`
- Defined in
`addon.ts:132 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L132>`__

View File

@ -0,0 +1,32 @@
Interface PreProcessSteps
=========================
.. code-block:: json
interface PreProcessSteps {
resize(algorithm): PreProcessSteps;
}
- Defined in
`addon.ts:108 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L108>`__
Methods
#####################
.. rubric:: resize
.. code-block:: json
resize(algorithm): PreProcessSteps
**Parameters**
- algorithm: string| :doc:`resizeAlgorithm <../enums/resizeAlgorithm>`
**Returns** :doc:`PreProcessSteps <PreProcessSteps>`
- Defined in
`addon.ts:109 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L109>`__

View File

@ -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 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L60>`__
Properties
#####################
.. rubric:: data
.. code-block:: json
data: number[]
- Defined in
`addon.ts:61 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L61>`__
Methods
#####################
.. rubric:: getData
.. code-block:: json
getData(): number[]
**Returns** number[]
- Defined in
`addon.ts:64 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L64>`__
.. rubric:: getElementType
.. code-block:: json
getElementType(): element
**Returns** :doc:`element <../enums/element>`
- Defined in
`addon.ts:62 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L62>`__
.. rubric:: getShape
.. code-block:: json
getShape(): number[]
**Returns** number[]
- Defined in
`addon.ts:63 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L63>`__

View File

@ -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 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L66>`__
.. 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 <Tensor>`
- Defined in
`addon.ts:67 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L67>`__

View File

@ -0,0 +1,9 @@
Type alias Dimension
====================
.. code-block:: json
Dimension: number|[number,number]
- Defined in
`addon.ts:87 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L87>`__

View File

@ -0,0 +1,11 @@
Type alias SupportedTypedArray
==============================
.. code-block:: json
SupportedTypedArray: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array
- Defined in
`addon.ts:1 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L1>`__

View File

@ -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 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L11>`__