Skip to content

Commit

Permalink
[DOCS] Adding OVAny type to Nodejs API (#27605)
Browse files Browse the repository at this point in the history
Porting:  #27598

Signed-off-by: sgolebiewski-intel <[email protected]>
  • Loading branch information
sgolebiewski-intel authored Nov 19, 2024
1 parent 40152d1 commit 5bde1ab
Show file tree
Hide file tree
Showing 24 changed files with 268 additions and 189 deletions.
30 changes: 16 additions & 14 deletions docs/sphinx_setup/api/nodejs_api/addon.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Property addon
Output <./openvino-node/interfaces/Output>
OutputInfo <./openvino-node/interfaces/OutputInfo>
OutputTensorInfo <./openvino-node/interfaces/OutputTensorInfo>
OVAny <./openvino-node/types/OVAny>
PartialShape <./openvino-node/interfaces/PartialShape>
PartialShapeConstructor <./openvino-node/interfaces/PartialShapeConstructor>
PrePostProcessor <./openvino-node/interfaces/PrePostProcessor>
Expand All @@ -39,19 +40,20 @@ The **openvino-node** package exports ``addon`` which contains the following pro

.. code-block:: ts
interface NodeAddon {
export interface NodeAddon {
Core: CoreConstructor;
PartialShape: PartialShapeConstructor;
Tensor: TensorConstructor;
element: typeof element;
PartialShape: PartialShapeConstructor;
preprocess: {
PrePostProcessor: PrePostProcessorConstructor;
resizeAlgorithm: typeof resizeAlgorithm;
resizeAlgorithm: typeof resizeAlgorithm;
PrePostProcessor: PrePostProcessorConstructor;
};
}
element: typeof element;
}
* **Defined in:**
`addon.ts:591 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L192>`__
`addon.ts:669 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L669>`__


Properties
Expand All @@ -71,7 +73,7 @@ Properties
- CoreConstructor: :doc:`CoreConstructor <./openvino-node/interfaces/CoreConstructor>`

- **Defined in:**
`addon.ts:592 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L592>`__
`addon.ts:670 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L670>`__


.. rubric:: PartialShape
Expand All @@ -87,7 +89,7 @@ Properties
- PartialShapeConstructor: :doc:`PartialShapeConstructor <./openvino-node/interfaces/PartialShapeConstructor>`

- **Defined in:**
`addon.ts:594 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L594>`__
`addon.ts:672 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L672>`__

.. rubric:: Tensor

Expand All @@ -102,7 +104,7 @@ Properties
- TensorConstructor: :doc:`TensorConstructor <./openvino-node/interfaces/TensorConstructor>`

- **Defined in:**
`addon.ts:593 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L593>`__
`addon.ts:671 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L671>`__


.. rubric:: element
Expand All @@ -118,7 +120,7 @@ Properties
- element: typeof :doc:`element <./openvino-node/enums/element>`

- **Defined in:**
`addon.ts:600 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L600>`__
`addon.ts:678 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L678>`__


.. rubric:: preprocess
Expand All @@ -128,15 +130,15 @@ Properties
.. code-block:: ts
preprocess: {
PrePostProcessor: PrePostProcessorConstructor;
resizeAlgorithm: typeof resizeAlgorithm;
PrePostProcessor: PrePostProcessorConstructor;
}
* **Type declaration:**

- PrePostProcessor: :doc:`PrePostProcessorConstructor <./openvino-node/interfaces/PrePostProcessorConstructor>`
- resizeAlgorithm: typeof :doc:`resizeAlgorithm <./openvino-node/enums/resizeAlgorithm>`
- PrePostProcessor: :doc:`PrePostProcessorConstructor <./openvino-node/interfaces/PrePostProcessorConstructor>`

- **Defined in:**
`addon.ts:596 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L596>`__
`addon.ts:674 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L674>`__

2 changes: 2 additions & 0 deletions docs/sphinx_setup/api/nodejs_api/nodejs_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ For more details, refer to the
API Development
#####################

Get started with OpenVINO Node.js API development :doc:`here <./addon>`.

OpenVINO 2024.4 has introduced the following methods:

- :ref:`Model.clone() <clone>`
Expand Down
22 changes: 11 additions & 11 deletions docs/sphinx_setup/api/nodejs_api/openvino-node/enums/element.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Enumeration element
f32: number
* **Defined in:**
`addon.ts:640 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L640>`__
`addon.ts:658 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L658>`__


.. rubric:: f64
Expand All @@ -22,7 +22,7 @@ Enumeration element
f64: number
* **Defined in:**
`addon.ts:641 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L641>`__
`addon.ts:659 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L659>`__


.. rubric:: i16
Expand All @@ -34,7 +34,7 @@ Enumeration element
i16: number
* **Defined in:**
`addon.ts:637 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L637>`__
`addon.ts:655 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L655>`__


.. rubric:: i32
Expand All @@ -46,7 +46,7 @@ Enumeration element
i32: number
* **Defined in:**
`addon.ts:638 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L638>`__
`addon.ts:656 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L656>`__


.. rubric:: i64
Expand All @@ -58,7 +58,7 @@ Enumeration element
i64: number
* **Defined in:**
`addon.ts:639 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L639>`__
`addon.ts:657 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L657>`__


.. rubric:: i8
Expand All @@ -70,7 +70,7 @@ Enumeration element
i8: number
* **Defined in:**
`addon.ts:636 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L636>`__
`addon.ts:654 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L654>`__


.. rubric:: string
Expand All @@ -82,7 +82,7 @@ Enumeration element
string: string
* **Defined in:**
`addon.ts:642 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L642>`__
`addon.ts:660 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L660>`__


.. rubric:: u16
Expand All @@ -94,7 +94,7 @@ Enumeration element
u16: number
* **Defined in:**
`addon.ts:634 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L634>`__
`addon.ts:652 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L652>`__


.. rubric:: u32
Expand All @@ -106,7 +106,7 @@ Enumeration element
u32: number
* **Defined in:**
`addon.ts:633 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L633>`__
`addon.ts:651 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L651>`__


.. rubric:: u64
Expand All @@ -118,7 +118,7 @@ Enumeration element
u64: number
* **Defined in:**
`addon.ts:635 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L635>`__
`addon.ts:653 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L653>`__


.. rubric:: u8
Expand All @@ -130,5 +130,5 @@ Enumeration element
u8: number
* **Defined in:**
`addon.ts:632 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L632>`__
`addon.ts:650 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L650>`__

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Enumeration resizeAlgorithm
RESIZE_CUBIC: number
- **Defined in:**
`addon.ts:647 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L647>`__
`addon.ts:663 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L663>`__


.. rubric:: RESIZE_LINEAR
Expand All @@ -22,7 +22,7 @@ Enumeration resizeAlgorithm
RESIZE_LINEAR: number
- **Defined in:**
`addon.ts:648 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L648>`__
`addon.ts:666 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L666>`__


.. rubric:: RESIZE_NEAREST
Expand All @@ -34,5 +34,5 @@ Enumeration resizeAlgorithm
RESIZE_NEAREST: number
- **Defined in:**
`addon.ts:646 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L646>`__
`addon.ts:664 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L664>`__

Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ Interface CompiledModel
output(): Output;
output(index): Output;
output(name): Output;
setProperty(properties: {[propertyName: string]: string | number | boolean}): void;
setProperty(properties: Record<string, OVAny>): void;
}
CompiledModel represents a model that is compiled for a specific device by applying
multiple optimization transformations, then mapping to compute kernels.

* **Defined in:**
`addon.ts:303 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L303>`__
`addon.ts:317 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L317>`__


Properties
Expand All @@ -40,7 +40,7 @@ Properties
It gets all inputs of a compiled model.

- **Defined in:**
`addon.ts:305 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L305>`__
`addon.ts:319 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L319>`__


.. rubric:: outputs
Expand All @@ -54,7 +54,7 @@ Properties
It gets all outputs of a compiled model.

- **Defined in:**
`addon.ts:307 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L307>`__
`addon.ts:321 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L321>`__


Methods
Expand All @@ -68,7 +68,7 @@ Methods

.. code-block:: ts
getProperty(propertyName): string | number | boolean
getProperty(propertyName): OVAny
It gets the property for the current compiled model.

Expand All @@ -78,10 +78,10 @@ Methods

A string to get the property value.

* **Returns:** string | number | boolean
* **Returns:** :doc:`OVAny <../types/OVAny>`

* **Defined in:**
`addon.ts:313 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L313>`__
`addon.ts:327 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L327>`__



Expand All @@ -99,7 +99,7 @@ Methods
* **Returns:** :doc:`InferRequest <InferRequest>`

- **Defined in:**
`addon.ts:318 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L318>`__
`addon.ts:332 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L332>`__


.. rubric:: exportModelSync
Expand All @@ -114,7 +114,7 @@ Methods
* **Returns:** Buffer

- **Defined in:**
`addon.ts:325 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L325>`__
`addon.ts:339 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L339>`__


.. rubric:: input
Expand All @@ -133,7 +133,7 @@ Methods
A compiled model input.

* **Defined in:**
`addon.ts:349 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L349>`__
`addon.ts:363 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L363>`__


.. code-block:: ts
Expand All @@ -153,7 +153,7 @@ Methods
A compiled model input.

* **Defined in:**
`addon.ts:355 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L355>`__
`addon.ts:369 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L369>`__


.. code-block:: ts
Expand All @@ -173,7 +173,7 @@ Methods
A compiled model input.

* **Defined in:**
`addon.ts:361 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L361>`__
`addon.ts:375 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L375>`__


.. rubric:: output
Expand All @@ -191,7 +191,7 @@ Methods
A compiled model output.

* **Defined in:**
`addon.ts:331 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L331>`__
`addon.ts:345 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L345>`__


.. code-block:: ts
Expand All @@ -215,7 +215,7 @@ Methods
A compiled model output.

* **Defined in:**
`addon.ts:337 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L337>`__
`addon.ts:351 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L351>`__


.. code-block:: ts
Expand All @@ -239,7 +239,7 @@ Methods
A compiled model output.

* **Defined in:**
`addon.ts:343 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L343>`__
`addon.ts:357 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L357>`__


.. rubric:: setProperty
Expand All @@ -249,7 +249,7 @@ Methods

.. code-block:: ts
setProperty(properties): void
setProperty(properties: Record<string, OVAny>): void
It sets properties for the current compiled model. Properties can be retrieved via
:ref:`CompiledModel.getProperty <getProperty>`
Expand All @@ -260,14 +260,12 @@ Methods

.. code-block:: ts
properties: {
[propertyName: string]: string | number | boolean;
}
properties: Record<string, OVAny>,
An object with the key-value pairs (property name, property value).

* **Returns:** void

* **Defined in:**
`addon.ts:368 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L368>`__
`addon.ts:382 <https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/js/node/lib/addon.ts#L382>`__

Loading

0 comments on commit 5bde1ab

Please sign in to comment.