20 Star 88 Fork 182

Ascend / mindxsdk-referenceapps

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
mindxsdk-referenceapps @ 4eb4770
Loading...
README
Apache-2.0

中文|英文

MindX SDK Reference Apps

MindX SDK 是华为推出的软件开发套件(SDK),提供极简易用、高性能的API和工具,助力昇腾AI处理器赋能各应用场景。

mxSdkReferenceApps是基于MindX SDK开发的参考样例。

版本说明

请在SDK产品选择页面选择您使用的产品后,通过下拉框选择支持的SDK版本并查看配套关系。

目前SDK分为:制造质检 mxManufacture、视觉分析 mxVision、检索聚类 mxIndex
以上分支版本号相同,为适配不同的方向的SDK组件。

  • 当前分支样例版本适配说明如下:
    SDK版本 CANN版本
    2.0.4 5.0.4

目录结构与说明

目录 说明
build 用户贡献样例构建目录
contrib 用户贡献样例目录
docs 文档目录
mxVision 官方应用样例目录
tools 开发测试相关工具
tutorials 官方开发样例和文档参考工程目录

安装

按照如下步骤搭建环境:
(1) 在昇腾文档中选择CANN 软件安装指南,点击进入文档。
(2) 根据文档了解整体流程并根据文档进行硬件及CANN软件安装。
(3) 在SDK下载页面中选择MindX SDK {版本} {产品} 用户指南
(4) mxManufacture和mxVision需根据不同开发(使用MindStudio开发/使用命令行方式开发)中对应环境准备章节完成安装。

开发样例

根据以下表单,选择需要运行的样例,并按照readme部署相关样例和参考工程

样例名称 简介
DvppWrapper接口样例 对图片实现编码,解码,缩放,抠图,以及把样例图片编码为264视频文件
图像检测样例 c++和python版本的图像检测样例,可刷输出检测结果
c++图片输入yolov3样例 c++语言的yolov3图像检测样例及yolov3的后处理模块开发
c++视频输入yolov3样例 针对视频输入的c++版本yolov3样例
绘图单元使用样例 使用osd对图像进行自定义绘图的样例
输入输出插件使用演示 对多种输入输出方式进行演示的样例
元数据输出输出样例 如何自行编解码元数据的演示样例
SDK插件开发 4-1章节对应的样例代码
模型后处理插件开发 4-2章节对应的演示代码
自定义proto结构体 4-3章节对应的演示代码
自定义后处理插件开发 4-4章节对应的演示代码
  1. SDK已支持的模型直接使用mxpi_{类型}postprocessor插件(SDK2.0.4后处理)配置对应参数即可(SDK2.0.4模型支持列表)
  2. 未支持的模型根据任务类型,选择SDK已经支持的后处理基类(目标检测,分类任务,语义分割,文本生成)(SDK2.0.4后处理基类)去派生一个新的子类,参考模型后处理插件开发进行开发。
  3. 如果当前后处理基类所采用的数据结构无法满足需求,用户需要自行开发自定义后处理插件开发,或将tensor数据通过元数据输出输出样例输出至外部来处理

运行

根据以下表单,选择需要运行的样例,并按照readme进行第三方依赖的安装及样例下载运行

样例名称 语言 适配SDK版本 简介
动作识别 python >=2.0.4 单人独处、逗留超时、快速移动、剧烈运动、离床检测、攀高检测六种应用场景
AI风景画 python >=2.0.4 从结构化描述生成对应风景照片
自动语音识别 python >=2.0.4 端到端的自动语音识别(AutoSpeechRecognition)+文本关键词识别(KeyWordRecognition)
文本分类 c++ >=2.0.4 新闻文本分类类别:体育、健康、军事、教育、汽车
车牌识别 c++ >=2.0.4 对图像中的车牌进行检测,并对检测到每一个车牌进行识别
卡通图像生成 c++ >=2.0.4 通用场景下的jpg图片卡通化
黑白图像上色 python >=2.0.4 输入黑白图像,自动对黑白图像进行上色,还原彩色图像
人群计数 c++ >=2.0.4 人群计数目标检测,输出可视化结果
驾驶员状态识别 python >=2.0.4 识别视频中的驾驶员状态
边缘检测 c++ >=2.0.4 图像边缘提取,输出可视化结果
EfficientDet python >=2.0.4 使用 EfficientDet 模型进行目标检测
目标检测 python >=2.0.4 对图像中的目标进行画框并且标注置信度
口罩识别 python >=2.0.4 对原图像的目标以及口罩进行识别画框
目标替换 python >=2.0.4 进行目标检测,脸部关键点推理以及目标替换,将替换结果可视化并保存
情绪识别 python >=2.0.4 采集图片中的目标图像,然后利用情绪识别模型推理情绪类别
目标跟踪 python >=2.0.4 视频目标检测和跟踪,对行人进行画框和编号
语义分割 python >=2.0.4 对图片实现语义分割功能
疲劳驾驶识别 python >=2.0.4 对视频中驾驶人员疲劳状态识别与预警
火灾识别 python >=2.0.4 对视频中高速公路车辆火灾和烟雾的识别告警
手势关键点 python >=2.0.4 检测图像中所有的人手,输出手势关键点连接成的手势骨架
头部姿态识别 python >=2.0.4 对图像中的头部进行姿态识别,输出可视化结果
安全帽识别 python >=2.0.4 两路视频的安全帽去重识别,并对为佩戴行为告警
人体语义分割 c++ >=2.0.4 对输入图片中的人像进行语义分割操作,然后输出mask掩膜图,将其与原图结合,生成标注出人体部分的人体语义分割图片
个体属性识别 python >=2.0.4 识别多种目标属性信息,包括年龄、性别、颜值、情绪、脸型、胡须、发色、是否闭眼、是否配戴眼镜、目标质量信息及类型等
语音关键词检测 python >=2.0.4 对语音进行关键词检测
人像分割 python >=2.0.4 基于MMNET解决移动设备上人像抠图的问题,旨在以最小的模型性能降级在移动设备上获得实时推断
单目深度估计 python >=2.0.4 基于AdaBins室内模型的单目深度估计,输出目标图像的深度图
多路视频检测 c++ >=2.0.4 同时对两路本地视频或RTSP视频流(H264或H265)进行YOLOv3目标检测,生成可视化结果
小麦检测 c++ >=2.0.4 使用yolov5对图像中的小麦进行识别检测
OCR身份证检测识别 python >=2.0.4 对身份证进行识别和检测
OCR关键词检测 python >=2.0.4 对图片进行识别并检测是否包含指定关键词
人体关键点检测 python >=2.0.4 输入一幅图像,可以检测得到图像中所有行人的关键点并连接成人体骨架
行人属性检测 python >=2.0.4 对检测图片中行人的定位和属性进行识别
人群密度计数 python >=2.0.4 输入一幅人群图像,输出图像当中人的计数(估计)的结果
文本检测 python >=2.0.4 识别图像文本的位置信息,将识别到的文本位置用线条框选出来
人像分割与背景替换 python >=2.0.4 使用Portrait模型对输入图片中的人像进行分割,然后与背景图像融合,实现背景替换
行人重识别 python >=2.0.4 检索给定照片中的行人ID,并与特征库对比展示
遥感影像地块分割检测样例 python >=2.0.4 输出遥感图像的可视化语义分割图
无人机遥感旋转目标检测 python >=2.0.4 输入一张待检测图片,可以输出目标旋转角度检测框,并有可视化呈现
3D目标检测 python >=2.0.4 对道路单色RGB图像进行三维目标检测
情感极性分类 python >=2.0.4 输入一段句子,可以判断该句子属于哪个情感极性
发言者识别 python >=2.0.4 对发言者进行识别。如果声纹库中不包含当前说话人,则对当前说话人进行注册并保存至声纹库,否则给出识别结果
图像超分辨率 python >=2.0.4 对输入的图片利用VDSR模型进行超分辨率重建
车道线检测 python >=2.0.4 对图像中的车道线进行检测,并对检测到的图像中的每一条车道线进行识别
车流量统计 c++ >=2.0.4 对视频中的车辆进行计数,实现对本地视频(H264)进行车辆动向并计数,最后生成可视化结果
视频手势识别运行 c++ >=2.0.4 对本地视频(H264)进行手势识别并分类,生成可视化结果
伪装目标分割 python >=2.0.4 对图像中的伪装目标进行识别检测,生成可视化分割结果

插件使用

以下表单描述了各插件在哪些样例中有使用,供用户查找参考

插件名称 参考设计位置 具体样例名称
appsrc run包 通用
mxpi_rtspsrc run包 SampleOsdVideo2Channels.pipeline
VideoObjectDetection.pipeline
SampleMotsimplesortv2.pipeline
SampleSkipframe.pipeline
mxpi_dataserialize run包 通用
appsink run包 通用
fakesink run包 通用
filesink run包 SampleOsd.pipeline
mxpi_parallel2serial run包 SampleNmsoverLapedroiv2.pipeline
SampleOsdVideo2Channels.pipeline
mxpi_distributor run包 SampleNmsoverLapedroiv2.pipeline
SampleOsdVideo2Channels.pipeline
mxpi_synchronize gitee-mxVision AllObjectsStructuring
mxpi_datatransfer gitee-mxVision MultiThread
mxpi_nmsoverlapedroi 弃用
mxpi_nmsoverlapedroiV2 run包 SampleNmsoverLapedroiv2.pipeline
mxpi_roigenerator run包 SemanticSegPostProcessor.pipeline
mxpi_semanticsegstitcher run包 SemanticSegPostProcessor.pipeline
mxpi_objectselector run包 SampleObjectSelector.pipeline
mxpi_skipframe run包 SampleSkipframe.pipeline
mxpi_imagedecoder run包 通用
mxpi_imageresize run包 通用
mxpi_imagecrop run包 Sample.pipeline
SampleNmsoverLapedroiv2.pipeline
SampleObjectSelector.pipeline
SampleOsdVideo2Channels.pipeline
mxpi_videodecoder run包 通用
mxpi_videoencoder run包 SampleOsdVideo2Channels.pipeline
mxpi_imageencoder run包 SampleOsd.pipeline
mxpi_imagenormalize run包 SampleImageNormalize.pipeline
mxpi_opencvcentercrop run包 SampleOpencvCenterCrop.pipeline
mxpi_warpperspective mindxsdk-referenceapps GeneralTextRecognition
mxpi_rotation mindxsdk-referenceapps GeneralTextRecognition
mxpi_modelinfer 弃用
mxpi_tensorinfer run包 通用
mxpi_objectpostprocessor run包 SampleObjectSelector.pipeline
Sample.pipeline
mxpi_classpostprocessor run包 Sample.pipeline
SampleOsdVideo2Channels.pipeline
BertMultiPorts.pipeline
mxpi_semanticsegpostprocessor run包 SemanticSegPostProcessor.pipeline
mxpi_textgenerationpostprocessor run包 TextGenerationPostProcessor.pipeline
mxpi_textobjectpostprocessor mindxsdk-referenceapps GeneralTextRecognition
mxpi_keypointpostprocessor run包 KeyPointPostProcessor.pipeline
mxpi_motsimplesort 弃用
mxpi_motsimplesortV2 run包
mxpi_facealignment mindxsdk-referenceapps FaceFeatureExtraction
mxpi_qualitydetection gitee-mxVision VideoQualityDetection
mxpi_dumpdata 用户指南
mxpi_loaddata 用户指南
mxpi_opencvosd run包 SampleOsd.pipeline
mxpi_object2osdinstances run包 SampleOsdVideo2Channels.pipeline
mxpi_class2osdinstances run包 SampleOsdVideo2Channels.pipeline
mxpi_osdinstancemerger run包 SampleOsdVideo2Channels.pipeline
mxpi_channelselector run包 SampleOsdVideo2Channels.pipeline
mxpi_channelimagesstitcher run包 SampleOsdVideo2Channels.pipeline
mxpi_channelosdcoordsconverter run包 SampleOsdVideo2Channels.pipeline
mxpi-bufferstablizer run包 SampleOsdVideo2Channels.pipeline

文档

参考各组件:制造质检 mxManufacture、视觉分析 mxVision、检索聚类 mxIndex内的用户手册链接获取相关文档。

社区

昇腾社区鼓励开发者多交流,共学习。开发者可以通过以下渠道进行交流和学习。

昇腾社区网站:hiascend.com

昇腾论坛:https://bbs.huaweicloud.com/forum/forum-726-1.html

SDK专属空间位于MindX应用使能子目录下

昇腾官方qq群:965804873

贡献代码

欢迎参与贡献。更多详情,请参阅我们的CONTRIBUTING.md

免责声明

参考设计不属于商用发布产品,仅供用户参考。如需使用,需要用户自行完成产品化,并进行安全防护,华为不承担安全责任。

版权说明

请参阅 License.md

**Apache License** **Version 2.0, January 2004** **http://www.apache.org/licenses/** TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION **1. Definitions**. "**License**" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "**Licensor**" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "**Legal Entity**" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "**control**" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "**You**" (or "**Your**") shall mean an individual or Legal Entity exercising permissions granted by this License. "**Source**" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "**Object**" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "**Work**" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "**Derivative Works**" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "**Contribution**" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "**submitted**" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "**Not a Contribution.**" "**Contributor**" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. **2. Grant of Copyright License**. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. **3. Grant of Patent License**. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. **4. Redistribution**. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: 1. You must give any other recipients of the Work or Derivative Works a copy of this License; and 2. You must cause any modified files to carry prominent notices stating that You changed the files; and 3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and 4. If the Work includes a "**NOTICE**" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. **5. Submission of Contributions**. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. **6. Trademarks**. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. **7. Disclaimer of Warranty**. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. **8. Limitation of Liability**. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. **9. Accepting Warranty or Additional Liability**. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

简介

MindX SDK Reference Apps 展开 收起
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
C++
1
https://gitee.com/ascend/mindxsdk-referenceapps.git
git@gitee.com:ascend/mindxsdk-referenceapps.git
ascend
mindxsdk-referenceapps
mindxsdk-referenceapps
master

搜索帮助