openvino
openvino copied to clipboard
[Good First Issue]: Enable Model.getOps() method
Context
OpenVINO works in Node.js environment! We are looking for new contributors who can help with enabling C++ API methods in JavaScript side.
First of all read Node.js API Contribution Guide.
Task Details
Expose ov::Model::get_ops() method.
From JavaScript side it will be Model.getOps() method.
This method:
- Doesn't have parameters
- Returns array of
ov::Nodeobjects Node.js API doesn't have bindings forov::Node. You need implement bindings for it.ov::Nodehas a lot of methods, you shouldn't implement all of them. Implement:- ov::Node::get_name() This method don't have parameters, it should be easy to bind it.
Useful links
- C++ API implementation of
Model::get_ops()method - Node.js API has similar implementation for
Output<ov::Node>, use this as the reference to implementov::Nodeclass.
What needs to be done?
- Create
NodeWrapclass that inherits fromNapi::ObjectWrapand representsov::Node, create a separate header and source file. - Implement
NodeWrapas minimal wrapper ofov::Nodewith ov::Node.get_name() method. - Add
ModelWrap.get_ops()method to ./src/bindings/js/node/src/model_wrap.cpp - Update TypeScript definitions in ./src/bindings/js/node/lib/addon.ts
- Create unit test for added functionality using Node.js Test Runner. It might look similar to this (Python code as an example):
model_operators = [op.get_name().split("_")[0] for op in model.get_ops()]
expected_ops = [
"Subtract",
"Transpose",
]
assert len(model_operators) == 14
for op in expected_ops:
assert op in model_operators
How to take this issue
To take this issue leave text: .take as the comment in this issue.
It will assign this issue to you automatically. Please, make sure that the issue has the status Contributors Needed and doesn't have another user in Assingnees.
Example Pull Requests
- https://github.com/openvinotoolkit/openvino/pull/23743
- https://github.com/openvinotoolkit/openvino/pull/24023
You may use this unfinished PR as the reference
- https://github.com/openvinotoolkit/openvino/pull/25470
Resources
- [NEW] Contribution Guide
- JavaScript API Developer Documentation
- Node.js API Reference
- Node.js bindings examples of usage
- What is OpenVINO?
- How to contributing to OpenVINO
- User documentation
Contact points
@almilosz @vishniakov-nikolai
Please, mention us in this issue discussion if you have any questions.
.take
Thank you for looking into this issue! Please let us know if you have any questions or require any help.
Reopening the task as the PR seems to have been abandoned.
@p-wysocki @almilosz Can I take this up if no one is working on it?
it would be great, have fun!
.take
Thank you for looking into this issue! Please let us know if you have any questions or require any help.
@almilosz I will give it a shot
@almilosz @vishniakov-nikolai sorry I got a but busy I'll raise a pr soon
If you have any issues with it, don't hesitate to ask :)
@almilosz can you please assign this to someone else , I have been busy a lot lately so couldn't make much progress , it's better to let someone else have a shot.
no worries @qxprakash thank you for your time, hope to see you again, later :)
task has been moved back to the available ones
@almilosz I'd like to take up this issue:)
it's yours, @itsaflamingo have fun
@itsaflamingo do you need any help with it?
@itsaflamingo do you need any help with it?
@vishniakov-nikolai I'm all good, just went away on vacation but I aim to have it finished this weekend, thanks for checking in:)
@vishniakov-nikolai I finished, but now I'm running into a git error that won't let me commit my changes:
error: 'cmake/developer_package/ncc_naming_style/ncc' does not have a commit checked out fatal: updating files failed
I'll submit pull request once I've solved that:')
@vishniakov-nikolai I figured it out. I made a git pull during the confusion, which updated other sets of files. Could we delete those sets of commits and simply keep the relevant ones?
Hi @itsaflamingo! Yes, sure, you can perform rebase on your branch to keep only your commits and then merge master branch with latest changes. Second option is to checkout new branch from latest master and perform cherry-pick each of your commits.
For example, second option:
git checkout -b fresh-master # as I can see, you didn't create new branch for your changes, pay attention to do not lose changes that you've made
git fetch upstream # upstream it's an https://github.com/openvinotoolkit/openvino.git remote. It it doesn't exist, create it by: git remote add upstream https://github.com/openvinotoolkit/openvino.git, and then perform fetch
git reset --hard upstream/master
git checkout -b new-name-of-your-branch
git cherry-pick bd1631a3b36787dc98436965ca079457f563de99 33f5233a224b1be1a021ac59dd9a6c8cef82149c 121288d0f3dbc94b2dc92e3da6924d0a9de63e00 bf1364a6d18a7cc190e1160bc1b0c7a20123edde f01d3aa70a9df4de45c56361ccb823f5b07a36b2
git push --set-upstream origin your-old-branch-name # in your case your-old-branch-name has name master. To do not create new PR you should perform force push to your previous branch
Also, replace this commit bf1364a6d18a7cc190e1160bc1b0c7a20123edde by only change in src/bindings/js/node/CMakeLists.txt to avoid unnecessary submodules update
.take
Thanks for being interested in this issue. It looks like this ticket is already assigned to a contributor. Please communicate with the assigned contributor to confirm the status of the issue.
Hi @AkshatShrivastava0104, to participate in Google Summer of Code you have to complete Prerequisite Task. It means that you should prepare a PR with a solution to some issue. Are you still working on this one? I'd love to hear from you, Alicja
can i work on this @almilosz ?
yes, it's open now. I can assign you :)
hello, @Saketh1702 Are you still working on it? Do you have any questions?
.take
Thank you @nashez for your contribution! I encourage you to visit GFI board from time to time and take tasks you are interested in