openvino icon indicating copy to clipboard operation
openvino copied to clipboard

Expose Model.get_output_shape() method to Node.js API

Open hegdeadithyak opened this issue 10 months ago • 7 comments

Details:

A method get_output_shape() to the Model class in the Node.js API of OpenVINO framework.This method would allow users to retrieve the output shape of a model, which is useful for understanding the model's output data.

Implemented

  • [x] add get_output_shape() method on C++ side (src/bindings/js/node/src/model.cpp)
  • [x] update TypeScript definition (src/bindings/js/node/lib/addon.ts)
  • [x] create unit test for added functionality using Node.js Test Runner

Fixes #23568

hegdeadithyak avatar Apr 03 '24 14:04 hegdeadithyak

I am not sure that it will compile successfully. Please compile your code using instructions from developer documentation: https://github.com/openvinotoolkit/openvino/tree/master/src/bindings/js/docs#openvino-node-package-developer-documentation

vishniakov-nikolai avatar Apr 08 '24 13:04 vishniakov-nikolai

Hi @hegdeadithyak! Would you like to continue?

vishniakov-nikolai avatar Apr 10 '24 14:04 vishniakov-nikolai

Hi @hegdeadithyak! Would you like to continue?

Yes I was in some important work so,Already started to work

hegdeadithyak avatar Apr 11 '24 12:04 hegdeadithyak

@vishniakov-nikolai I've implemented some changes and successfully compiled the file. Upon review, I couldn't identify any issues. However, if there are any concerns or further adjustments needed, please inform me.

Thanks, Adithya Hegde Kota

hegdeadithyak avatar Apr 13 '24 16:04 hegdeadithyak

Hey @vishniakov-nikolai while building it after making the changes it showed a warning stating but compiled and built successfully /home/adithyahegdekota/Documents/GitHub/openvin/src/bindings/js/node/src/model_wrap.cpp: In member function ‘Napi::Value ModelWrap::get_output_shape(const Napi::CallbackInfo&)’: /home/adithyahegdekota/Documents/GitHub/openvin/src/bindings/js/node/src/model_wrap.cpp:169:25: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<ov::Outputov::Node >::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 169 | if (idx >= 0 && idx < cm_outputs.size()) { so Should I type cast the idx now?

hegdeadithyak avatar May 07 '24 15:05 hegdeadithyak

@vishniakov-nikolai I have cleared all Test Cases as instructed.

hegdeadithyak avatar May 10 '24 10:05 hegdeadithyak

Hi @hegdeadithyak! One of the tests fails on Windows, please, look at it: https://github.com/openvinotoolkit/openvino/actions/runs/9060419207/job/24890782791?pr=23843#step:6:619 image

vishniakov-nikolai avatar May 13 '24 10:05 vishniakov-nikolai

@vishniakov-nikolai This might work for windows but on my System Pop!_OS 22.04 it fails so there is a chance for it to fail in windows.

hegdeadithyak avatar May 13 '24 11:05 hegdeadithyak

build_jenkins

vishniakov-nikolai avatar May 13 '24 11:05 vishniakov-nikolai

build_jenkins

vishniakov-nikolai avatar May 14 '24 13:05 vishniakov-nikolai

build_jenkins

vishniakov-nikolai avatar May 16 '24 20:05 vishniakov-nikolai