New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suport Ascend NPU #24277
Suport Ascend NPU #24277
Conversation
@hipudding Thanks a lot for the contribution!
|
Sure. Will add them ASAP. |
@@ -183,7 +183,8 @@ class CV_EXPORTS _InputArray | |||
#if OPENCV_ABI_COMPATIBILITY < 500 | |||
STD_ARRAY =14 << KIND_SHIFT, //!< removed: https://github.com/opencv/opencv/issues/18897 | |||
#endif | |||
STD_ARRAY_MAT =15 << KIND_SHIFT | |||
STD_ARRAY_MAT =15 << KIND_SHIFT, | |||
NPU_MAT =16 << KIND_SHIFT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For such customization it is better to use approach described here: #20869
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinks for this suggestion. I saw this approach will merge into 5.x. For current release(4.x), Does it has same features to support customer Mat types?
I'd like to use the old way (CUSTOMER_MAT) for 4.x(I don't want to break anything for this stable branch), and refactor it to 5.x after this approach finished. What do you think.
Change NPU_MAT to ASCEND_MAT.
Here's english version website of Ascend(https://www.hiascend.com/en/document), Please have a try and see whether it can provide enough informations.
Could you give me the visitor's IP address and public key(security information, please send me by email: huafengchun@gmail.com). I will setup a CI VM for opencv, You will be the managers of this machine. And also, Dockerfile is added for compile and run opencv tests on Ascend NPU backend. @see opencv/opencv_contrib#3552 |
Ascend NPU is a series of AI processors. [hiascend](https://www.hiascend.com/). This commit make InputArray and OutputArray support a new Mat structor called NpuMat, which has a same interface with Mat and GpuMat. And also, python bindings generator support NpuMat for python interface.
NPU is too generic and there are more than one NPU vendors. It's better to use ASCEND_MAT instead.
671b1e6
to
b882619
Compare
@asmorkalov @opencv-alalek I found CI is failed due to added/removed symbols here. But I found these symbols is not relate to this PR. Could you give me some suggestions to pass it? Thanks. |
Thanks for your suggestion, the tutorial of Ascend NPU image processing is already available and included in “opencv_contrib/modules/cannops/tutorials/ascend_npu_image_processing.markdown”. |
Add a comma to the last element of the enumeration for the future edits.
Ascend NPU is a series of AI processors.
hiascend.
This commit make InputArray and OutputArray support a new Mat structor called NpuMat, which has a same interface with Mat and GpuMat. And also, python bindings generator support NpuMat for python interface.
This PR is only for type declaration and code generation. For implementation, please refer to opencv_contrib#3552
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.