• [技术干货] c obs sdk 编译 obs_demo
    在编译 obs-demo 时 出现  链接不使用 /SAFESEH
  • [昇腾小姐姐趣味实验] 基于MindXSDK的中文语音识别推理实验
    随着科技的发展让机器听懂人类语言已经成为现实这其中的奥秘就是——语音识别技术 语音识别已渐渐融入到我们的生活当中它让我们的生活变得更便捷、更高效、也更智能本期趣味实验有关语音识别的基于MindX SDK的中文语音识别推理实验 一起来看看吧!实验介绍本实验将通过创建基于昇腾310处理器的推理环境,使用两个离线推理模型Conformer和Transformer模型,借助MindX SDK mxVision 将中文语音数据集识别成对应的文字,实现中文语音识别的功能。实验大纲◆ 实验背景◆ 实验介绍◆ 实验环境准备◆ 数据与模型◆ 项目介绍◆ MindX SDK开发 :转换离线模型及插件开发◆ MindX SDK开发 :业务流程编排◆ MindX SDK开发 :编写应用代码◆ 课后实践实验教程​点击查看完整实验教程欢迎在下方评论区留言讨论您可以在这里展示您的DIY成果!同时欢迎大家推荐demo~
  • [问题求助] [Atlas200DK] 板端升级cann-toolkit_6.0.RC1.alpha001后,板端profiling失败
    问题求助:板端升级cann-toolkit_6.0.RC1.alpha001后,板端profiling失败,环境:#Atlas200DK#driver/firmware: A200dk-npu-driver-21.0.4-ubuntu18.04-aarch64-minirc.tar (板端已安装成功)#离线推理包:Ascend-cann-nnrt_6.0.RC1.alpha001_linux-aarch64.run (板端已安装在/usr/local下)#toolkit:(板端已安装在/home/HwHiAiUser/Ascend/ascend-toolkit下,显示success)#app:msame经过修改,可以直接运行指定模型无需参数。(板端单独运行./msame可以正常推理模型)profiling指令为:./Ascend-cann-toolkit_6.0.RC1.alpha001_linux-aarch64.run --install. /home/HwHiAiUser/Ascend/ascend-toolkit/set_env.sh/home/HwHiAiUser/Ascend/ascend-toolkit/latest/toolkit/tools/profiler/bin/msprof  --output=/home/HwHiAiUser/1onnx_task --application=/home/HwHiAiUser/msame --sys-hardware-mem=on --sys-io-profiling=on --sys-pid-profiling=on --sys-profiling=on --sys-cpu-profiling=on --sys-devices=1 --aic-mode=task-based --runtime-api=on --model-execution=on现象:[ERROR] Init platform by driver faild!
  • [MindX SDK] 问下mindxsdk是否支持根据位置过滤目标框的组件
    比如640*640的图像,我只想要中间320*320的目标框,问下我该如何开发
  • [问题求助] 【SS928V100_SDK_V2.0.2.0】模型推理报错
    【功能模块】模型推理报错11002,在调用libcpu_kernels.so时失败,搜索该文件并未缺失。【操作步骤&问题现象】1、2、【截图信息】【日志信息】(可选,上传日志内容或者附件)clmdlGetDynamicBatch index = 0 batch = 1aclmdlGetDynamicBatch index = 1 batch = 2[kkkkkkkkk]:count:2aclmdlSetDynamicBatchSize , batchSize is 1[EVENT] CCECPU(6998,main_test):1970-01-02-01:18:02.507.798 [ae_so_manager.cc:440][LoadSo][tid:6998][AICPU_PROCESSER] Single so manager init failed, soFile is /usr/lib64/aicpu_kernels/0/aicpu_kernels_device/libcpu_kernels.so.[ERROR] CCECPU(6998,main_test):1970-01-02-01:18:02.507.979 [ae_so_manager.cc:453][LoadSo][tid:6998][AICPU_PROCESSER] Single so manager init failed, soFile is /usr/lib64/aicpu_kernels/libcpu_kernels.so.[EVENT] CCECPU(6998,main_test):1970-01-02-01:18:02.508.036 [ae_so_manager.cc:265][GetApi][tid:6998][AICPU_PROCESSER] Load so libcpu_kernels.so failed.[ERROR] CCECPU(6998,main_test):1970-01-02-01:18:02.508.090 [ae_kernel_lib_aicpu.cc:104][CallKernelApi][tid:6998][AICPU_PROCESSER] Get RunCpuKernel api from libcpu_kernels.so failed.[ERROR] CCECPU(6998,main_test):1970-01-02-01:18:02.508.171 [aicpusd_event_process.cpp:885][ExecuteTsKernelTask][tid:6998] Aicpu engine process failed, result[11002].[ERROR] DRV(6998,main_test):1970-01-02-01:21:27.520.192 [devdrv_aicpufw.c:182]6998 ext_mpi_aicpu_get_event:---tid:6998--> get event from TSFW timeout.[ERROR] DRV(6998,main_test):1970-01-02-01:24:52.320.172 [devdrv_aicpufw.c:182]6998 ext_mpi_aicpu_get_event:---tid:6998--> get event from TSFW timeout.
  • [问题求助] SS928V100_SDK_V2.0.2.0模型推理报错
    SS928V100_SDK_V2.0.2.0模型推理报错, Single so manager init failed, soFile is /usr/lib64/aicpu_kernels/0/aicpu_kernels_device/libcpu_kernels.so.
  • [MindX SDK] PP-Picodet目标检测
    # MindX SDK -- PP-Picodet目标检测案例分享 ## 1 案例概述 ### 1.1 概要描述 > 项目地址:[contrib/PicoDet · Ascend/mindxsdk-referenceapps - 码云 - 开源中国 (gitee.com)](https://gitee.com/ascend/mindxsdk-referenceapps/tree/master/contrib/PicoDet) 本项目基于MindX SDK,在昇腾平台上,开发端到端目标检测参考设计,实现对图像中的对象进行检测识别功能。 ### 1.2 模型介绍 本项目使用的目标检测模型是PP-Picodet,是由PaddleDetection提出的轻量级系列模型,模型以及项目参考[PaddleDetection](https://github.com/PaddlePaddle/PaddleDetection/blob/release/2.3/configs/picodet/README_cn.md) ### 1.3 实现流程 ``` 推理环境准备 --> 模型转换 --> 功能插件开发 --> 推理流程编排 --> 业务管理代码开发 ``` SDK推理流程图如下: ![](https://bbs-img.huaweicloud.com/data/forums/attachment/forum/20228/8/1659927159872684658.png) ## 2 软件方案介绍 ### 2.1 项目方案架构介绍 基于MindX SDK的目标检测业务流程为:待检测图片通过 appsrc 插件输入,然后使用图像解码插件 mxpi_imagedecoder 对图片进行解码,再通过图像缩放插件 mxpi_imageresize 将图像缩放至满足检测模型要求的输入图像大小要求,缩放后的图像输入模型推理插件 mxpi_tensorinfer 得到推理结果,推理结果输入 mxpi_objectpostprocessor 插件进行后处理,得到输入图片中所有的目标框位置和对应的置信度。最后通过输出插件 appsink 获取检测结果,并在外部进行可视化,将检测结果标记到原图上,本系统的各模块及功能描述如表1所示: 表1 系统方案各模块功能描述: | 序号 | 子系统 | 功能描述 | | ---- | -------------- | ------------------------------------------------------------ | | 1 | 图片输入 | 获取 jpg 格式输入图片 | | 2 | 图片解码 | 解码图片 | | 3 | 图片缩放 | 将输入图片放缩到模型指定输入的尺寸大小 | | 4 | 模型推理 | 对输入张量进行推理 | | 5 | 目标检测后处理 | 从模型推理结果计算检测框的位置和置信度,并保留置信度大于指定阈值的检测框作为检测结果 | | 6 | 结果输出 | 获取检测结果 | | 7 | 结果可视化 | 将检测结果标注在输入图片上 | ### 2.2 代码目录结构与说明 本工程名称为 PicoDet,工程目录如下所示: ``` ├── build.sh ├── dataset //用户自行创建 │ ├── annotations │ │ ├── instances_val2017.json │ └── val2017 │ └── images ├── PicodetPostProcess │ ├── build.sh │ ├── CMakeLists.txt │ ├── PicodetPostProcess.cpp │ └── PicodetPostProcess.h ├── models │ ├── coco.names //用户自行下载 │ ├── picodet.aippconfig │ └── picodet.cfg ├── picodet.pipeline ├── evaluate.py ├── main.py └── README.md ``` ## 3 开发环境准备 ### 3.1 环境依赖说明 推荐系统为ubuntu 18.04,环境依赖软件和版本如下表: | 软件名称 | 版本 | | -------------- | ----- | | ascend-toolkit | 5.0.4 | | mxVision | 2.0.4 | | python | 3.9.2 | ### 3.2 环境搭建 在编译运行项目前,需要设置环境变量: ``` . ${sdk_path}/set_env.sh . ${ascend_toolkit_path}/set_env.sh ``` ## 4 编译与运行 **步骤1** 模型获取 本项目中选用的模型是 PicoDet-S(320*320),可以直接从链接获取可用的onnx模型:[下载链接](https://gitee.com/link?target=https%3A%2F%2Fpaddledet.bj.bcebos.com%2Fdeploy%2Fthird_engine%2Fpicodet_s_320_coco.onnx)。 将下载好的onnx模型放入models目录下,执行转换命令: ``` atc --model=picodet_s_320_coco.onnx --output=picodet --output_type=FP32 --soc_version=Ascend310 --input_shape="image:1,3,320,320" --insert_op_conf=picodet.aippconfig --input_format=NCHW --framework=5 ``` **步骤2** 编译后处理插件,在主目录下执行如下命令,编译成功的插件安装在sdk插件库中 ``` bash build.sh ``` **步骤3** 下载标签文件coco.names 下载文件[coco2014.names](https://gitee.com/ascend/ModelZoo-PyTorch/blob/master/ACL_PyTorch/built-in/cv/Yolov3_for_Pytorch/coco2014.names),将下载的标签文件放入models目录中并修改文件名为**coco.names** **步骤3** 执行推理 ``` python3.9 main.py ${推理图片文件夹} ${结果保存文件夹} ``` ## 5 指标验证 ### 5.2 精度测试 **步骤1** 下载cocoval2017[数据集](https://gitee.com/link?target=http%3A%2F%2Fimages.cocodataset.org%2Fzips%2Fval2017.zip)与[标注文件](https://gitee.com/link?target=http%3A%2F%2Fimages.cocodataset.org%2Fannotations%2Fstuff_annotations_trainval2017.zip),放入主目录下的dataset文件夹中,确保目录结构如2.2章节所示 **步骤2** 修改 models/picodet.cfg中参数 ``` SCORE_THRESH=0.025 NMS_THRESH=0.6 ``` **步骤3** 执行测试脚本 ``` python3.9 evaluate.py ``` 得到精度结果 ![](https://bbs-img.huaweicloud.com/data/forums/attachment/forum/20228/8/1659927396626364925.png) 精度值达到 0.262,与源模型精度0.271相差0.009,满足精度要求
  • [经验分享] 【MindStudio体验官第一期活动】如何使用MindStudio完成卡通风格迁移
    张小白曾经在 《张小白带你玩转Atlas 200DK+CANN 5.0.4+MindStudio 3.0.4》系列文章中体验过MindStudio 3.0.4,当时MindStudio确实在多处文章中出现,包括安装:https://bbs.huaweicloud.com/blogs/345869 ,模型转换 https://bbs.huaweicloud.com/blogs/348182 等等。因为使用MindStudio的方式跟直接在终端运行推理的方式略有不同,比如说在MindStudio运行作业,CMakesLists.txt文件可能需要修改等等,这些张小白在文中还特意指出过。但是作为一个正在冉冉升起的CANN集成化开发工具,MindStudio确实做得越来越出色了。近期的MindStudio体验第一期正在进行中:https://bbs.huaweicloud.com/forum/thread-190510-1-1.html ,下载链接中的附件,解压后,会发现有两个活动:活动1是使用MindX SDK复现应用,活动2是MindX SDK开发应用。于是,张小白聪明地先选择了复现。当然,体验前没那么简单,需要做好几件事情:(1)阅读 https://www.hiascend.com/document/detail/zh/mindstudio/50RC1/msug/msug_000144.html 中的相关内容,了解如何通过MindStudio 5.0.RC进行MindX SDK类型的应用开发。(2)准备MindStudio 5.0.RC的环境以及跟其配套的CANN环境。(3)查看并选择MindX SDK要复现的案例:https://www.hiascend.com/developer/case-studies(4)在相关环境上复现相关案例。当然,当张小白打开 https://www.hiascend.com/developer/case-studies 想查看案例的时候,却发现 通过过滤MindX SDK,只有 Atlas 300I Pro的1个案例:以及Atlas 800的 13个案例:本来还想找200DK的案例,然后用自己的200DK做个尝试的。但是真的没有。张小白有点不甘心,总觉得哪里错了。一方面,将问题发到MindStudio的体验官群里面(但是这是个周末),一方面,强行打开了 ”图像卡通风格迁移“的案例:https://www.hiascend.com/zh/developer/mindx-sdk/case-studies/051ec03c-ea76-4fca-9c2e-5bf2f98a4909并打开上面gitee的链接:https://gitee.com/ascend/mindxsdk-referenceapps/tree/master/contrib/CartoonGANPicture查看相关内容。同时,MindStudio群里面发出了一个新的链接,里面含有快速入门样例:https://www.hiascend.com/document/detail/zh/mindstudio/50RC2/progressiveknowledge/index.html打开链接才知道,zip中的版本是5.0.RC1,而新的链接的版本是5.0.RC2.于是,两难的抉择放在了张小白面前,到底是按照 体验指引的文档要求,从 应用案例的页面着手,还是 按照最新发的链接的要求,从”快速入门样例“的页面着手?再仔细看看文档,发现后者的链接其实并没有应用案例。它只是告诉了MindStudio开发应用的全过程。所以还是从卡通风格迁移案例开始吧。在 https://gitee.com/ascend/mindxsdk-referenceapps/tree/master/contrib/CartoonGANPicture 连接,找到下载连接:先把这个下载下来,备用: https://gitee.com/link?target=https%3A%2F%2Fmindx.sdk.obs.cn-north-4.myhuaweicloud.com%2Fmindxsdk-referenceapps%2520%2Fcontrib%2FCartoonGANPicture%2Fmodel.zip然后我们到昇腾官网,打开MindStudio主页:https://www.hiascend.com/software/mindstudio点击下面的立即下载:可以看到:MindStudio 5.0.RC2配套的CANN版本需要是 CANN商用版本 5.1.RC2张小白又开始纠结起来,因为张小白玩的版本一直是社区版。难道MindStudio 5.0.RC2必须配套CANN的商用版才能使用吗?更何况 张小白想使用200DK完成案例复现,而200DK的dd镜像最高只有 5.1.RC1.alpha005版本:https://bbs.huaweicloud.com/forum/thread-139685-1-1.html这样又需要通过制卡的方式来搭建环境,还要装一堆驱动和opencv之类的东西,体验之旅将更为困难。所以,是不是只有等着 活动举办方出一个镜像方可体验MindStudio 5.0呢?与之配套的CANN版本到底要求是多少呢?还烦请专家回答。谢谢~~
  • [问题求助] 华为云OBS-SDK-JAVA
    求助一下,断点续传上传和下载,如何中断上传或下载?
  • [部署上线] 在线服务使用modelarts sdk报错,"error_code": "ModelArts.4302",
    在线服务使用modelarts sdk报错,"error_code": "ModelArts.4302",
  • [MindX SDK] gitee/Ascend/mindxsdk-referenceapps/基于MxBase 的yolov3视频流推理样例:运行报错
    在gitee上:Ascend/mindxsdk-referenceapps/tutorials/mxBaseVideoSample:基于MxBase 的yolov3视频流推理样例程序链接:https://gitee.com/ascend/mindxsdk-referenceapps/tree/master/tutorials/mxBaseVideoSample操作步骤如下:1.已用ffmpeg对mp4视频转码h264,并将视频放入mediaServer中,运行mediaServer,有提示rtsp流地址如下已按照Readme执行操作,编译完毕,并配置上述rtsp流地址,在bash run.sh后,报错如下:rtsp流找不到程序内rtsp流地址写法如下图:求助,为什么找不到视频流,怎么解决。怎么样才能让程序获取到rtsp流
  • [MindX SDK] 【MindX SDK】【mxVision2.0.4】怎么整一个16路解码的sample例子
    【功能模块】因现在要做分析业务这块的适配 现在16路既然跑不起来 看下demomxVision-2.0.4/sample 模块跑不起来【操作步骤&问题现象】1、main_video_rtspsrc 接入rtsp视频例子2、main_image_reasoning 图片例子 这两个例子都跑不起来 下面是报错 看的不太懂,文件路径和模型路径等都反复确认 没有报错。运行环境run脚本也添加了export MX_SDK_HOME=/home/HwHiAiUser/mxVision-2.0.4export ACL_HOME=/usr/local/Ascend/ascend-toolkit/latest/acllibexport GST_PLUGIN_SCANNER=${MX_SDK_HOME}/opensource/libexec/gstreamer-1.0/gst-plugin-scannerexport GST_PLUGIN_PATH=${MX_SDK_HOME}/lib/:${MX_SDK_HOME}/lib/plugins:${MX_SDK_HOME}/lib/modelpostprocessors:${MX_SDK_HOME}/opensource/lib/:${MX_SDK_HOME}/opensource/lib/gstreamer-1.0:./lib:./lib/plugins:export LD_LIBRARY_PATH=/usr/local/python3.7.5/lib:${ACL_HOME}/lib64:/opt/boost/lib:/opt/ffmpeg/lib:${GST_PLUGIN_PATH}:$LD_LIBRARY_PATH【截图信息】下面是例子main_video_rtspsrc 运行报的错调试还是在pipe创建 不成功
  • [MindX SDK] ADNet 图像去噪参考设计案例分享
    # MindX SDK -- ADNet图像去噪参考设计案例 ## 1 案例概述 ### 1.1 概要描述 本案例为基于ADNet模型的图像去噪MindX SDK后处理开发,是在华为昇腾芯片的性能下对模型降噪后的图像进行保存,与原图像进行对比后计算出PSNR(峰值信噪比,是一种最普遍,最广泛使用的评鉴画质的客观量测法),在 BSD68 数据集上测试得到精度大小为30.05。 案例获取地址 https://gitee.com/ascend/mindxsdk-referenceapps/tree/master/contrib/ADNet ### 1.2 特性及适用场景 本案例中的 ADNet 模型适用于灰度图像的去噪,并可以返回测试图像的PSNR精度值。 ### 1.3 模型介绍 ADNet是一种包含注意力模块的卷积神经网络,主要包括用于图像去噪的稀疏块(SB)、特征增强块(FEB)、注意力块(AB)和重建块(RB)。具体来说,SB模块通过使用扩张卷积和公共卷积来去除噪声,在性能和效率之间进行权衡。FEB模块通过长路径整合全局和局部特征信息,以增强去噪模型的表达能力。 AB模块用于精细提取隐藏在复杂背景中的噪声信息,对于复杂噪声图像,尤其是真实噪声图像非常有效。 此外,FEB模块与AB模块集成以提高效率并降低训练去噪模型的复杂度。最后,RB模块通过获得的噪声映射和给定的噪声图像来构造去噪的图像。 本方案采用ADNET模型实现图像去噪功能,整体流程与开发流程如图1所示。我们将待检测的图像输入到整体框架中,通过图像解码、图像解码、图像缩放后输入到图像去噪模型中进行推理,推理得到一个去噪后的图像矩阵。然后,我们将该图像与原始图像之间计算出PSNR值,同时完成图像的可视化结果。 模型地址 https://gitee.com/ascend/ModelZoo-PyTorch/tree/master/ACL_PyTorch/contrib/cv/quality_enhancement/ADNet 论文地址 https://github.com/hellloxiaotian/ADNet 模型概述 https://www.hiascend.com/zh/software/modelzoo/models/detail/1/d360c03430f04185a4fe1aa74250bfea ### 1.4 实现流程 实现流程图如下图所示: ![流程.png](https://bbs-img.huaweicloud.com/data/forums/attachment/forum/20227/29/1659025002618395360.png) pipeline流程如下图所示: ![pipeline.png](https://bbs-img.huaweicloud.com/data/forums/attachment/forum/20227/29/1659024965870265007.png) ## 2 软件方案介绍 ### 2.1 技术原理 ADNet图像去噪模型的后处理的输入是 pipeline 中 mxpi_tensorinfer0 推理结束后通过 appsink0 输出的 tensor 数据,尺寸为[1* 1* 321* 481],将张量数据通过 pred 取出推测的结果值,将像素点组成的图片保存成result.jpg,同时通过提供的 BSD68 数据集完成模型 PSNR 的精度计算。 ### 2.2 项目方案架构介绍 项目主要由主函数,pipeline 文件,模型及其配置文件,测试数据集组成。主函数中构建业务流 stream 读取图片,通过 pipeline 在 SDK 环境下先后实现图像解码,图像缩放,模型推理的功能,最后从流中取出相应的输出数据完成图像保存并测试精度。 系统方案中各模块功能如下: | 序号 | 模块 | 功能描述 | | ---- | ------------- | ------------------------------------------------------------ | | 1 | appsrc | 向stream中发送数据,appsrc将数据发给下游元件 | | 2 | imagedecoder | 用于图像解码,当前只支持JPG/JPEG/BMP格式 | | 3 | imageresize | 对解码后的YUV格式的图像进行指定宽高的缩放,暂时只支持YUV格式的图像 | | 4 | tensorinfer | 对输入的张量进行推理 | | 5 | dataserialize | 将stream结果组装成json字符串输出 | | 6 | appsink | 从stream中获取数据 | | 7 | evaluate | 模型精度计算,输出图像降噪效果评估值PSNR | | 8 | transform | 对测试图像进行格式转换,evaluate 运行前需要进行尺寸调整 | ## 3 开发环境准备 ### 3.1 环境依赖说明 推荐系统为ubuntu 18.04,环境依赖软件和版本如下表 | 软件名称 | 版本 | | -------- | ------ | | MindX SDK | 2.0.4 | | Ascend-CANN-toolkit | 5.0.4 | | ubuntu | 18.04.1 LTS | | python | 3.9.2 | | cv2 | 4.5.5 | | numpy | 1.22.3 | | scikit-image| 0.16.2 | ### 3.2 环境搭建 #### 3.2.1 依赖安装 在服务器上进入指定的虚拟环境,并通过 conda install ~ 或者 pip install ~ 完成 python 相关库的安装。 #### 3.2.2 工程创建 本工程名称为ADNet,工程目录如下图所示: ``` ├── main.py //运行工程项目的主函数 ├── evaluate.py //精度计算 ├── transform.py //图像转换 ├── t.pipeline //pipeline ├── model //存放模型文件 | ├──aipp_adnet.cfg //预处理配置文件 ├── result.jpg //输出结果 ├── 流程.png //流程图 ├── pipeline.png //pipeline流程图 └──README.md ``` ### 3.3 环境变量设置 在编译运行项目前,需要设置环境变量 - 环境变量介绍 - MX_SDK_HOME 指向SDK安装包路径 - LD_LIBRARY_PATH 用于指定查找共享库(动态链接库)时除了默认路径之外的其他路径。 - PYTHONPATH Python中一个重要的环境变量,用于在导入模块的时候搜索路径 - GST_PLUGIN_SCANNER 用于查找plugin相关的依赖和库 - GST_PLUGIN_PATH 用于查找plugin相关的依赖和库 具体执行命令 ``` . ${MX_SDK_HOME}/set_env.sh . ${ascend-toolkit-path}/set_env.sh ``` ## 4 编译与运行 当已有模型的om文件,保存在ADNet/model/下 **步骤 1** 将任意一张jpg格式的图片存到当前目录下(./ADNet),命名为test.jpg。如果 pipeline 文件(或测试图片)不在当前目录下(./ADNet),需要修改 main.py 的pipeline(或测试图片)路径指向到所在目录。 **步骤 2** 按照模型转换获取om模型,放置在 ADNet/model 路径下。若未从 pytorch 模型自行转换模型,使用的是上述链接提供的 onnx 模型或者 om 模型,则无需修改相关文件,否则修改 main.py 中pipeline的相关配置,将 mxpi_tensorinfer0 插件 modelPath 属性值中的 om 模型名改成实际使用的 om 模型名;将 mxpi_imageresize0 插件中的 resizeWidth 和 resizeHeight 属性改成转换模型过程中设置的模型输入尺寸值。 **步骤 3** 在命令行输入 如下命令运行整个工程 ``` python3 main.py ``` **步骤 4** 图片检测。运行结束输出result.jpg。 ## 5 测试精度 **步骤 1** 安装数据集用以测试精度。数据集 BSD68 需要自行下载。 数据集下载链接: https://mindx.sdk.obs.cn-north-4.myhuaweicloud.com/mindxsdk-referenceapps%20/contrib/ADNet/BSD68.zip 在./ADNet目录下新建 dataset 文件夹与 BSD68文件夹,并将数据集下载至BSD68文件夹解压。我们运行以下命令对数据集完成格式与尺寸转换,将处理好的数据集保存在dataset文件夹中,此时ADNet文件夹的目录结构为如下所示。 ``` python3 transform.py ``` ``` ├── main.py //运行工程项目的主函数 ├── evaluate.py //精度计算 ├── transform.py //图像转换 ├── t.pipeline //pipeline ├── model //存放模型文件 | ├──aipp_adnet.cfg //预处理配置文件 ├── test.jpg //测试图像 ├── result.jpg //输出结果 ├── 流程.png //流程图 ├── pipeline.png //pipeline流程图 ├── BSD68 //原始数据集 ├── dataset //完成转换后的待测试数据集 └──README.md ``` **步骤 2** 修改 evaluate.py 中的 pipeline 路径与数据集路径与目录结构保持一致。修改完毕后运行如下命令完成精度测试,输出模型平均 PSNR 值。 ``` python3 evaluate.py ``` 模型在BSD68数据集上的精度达标,最终模型平均PSNR输出值为30.054,满足精度要求(PSNR ≥ 29.27)。 ![PSNR.png](https://bbs-img.huaweicloud.com/data/forums/attachment/forum/20227/29/1659025363202494353.png) ## 6 常见问题 ### 6.1 在执行样例时报错“No module named 'StreamManagerApi'” **问题描述:** ![q1.png](https://bbs-img.huaweicloud.com/data/forums/attachment/forum/20227/29/1659025391696627838.png) **解决方案:** 正确导入所需的环境变量。 ### 6.2 模型转换过程中无法选择我们需要的模型输入大小(321 * 481) **问题描述:** ![q2.png](https://bbs-img.huaweicloud.com/data/forums/attachment/forum/20227/29/1659025407430841981.png) **解决方案:** 模型的输入分辨率值(W与H)不能为奇数。转换模型时未导入aipp_config文件,需要配置resize之后在图像左侧和上侧设置padding值为1,从而满足模型的输入。
  • [问题求助] composer 安装后php SDK 下载的目录找不到
    【功能模块】composer  php SDK 安装【操作步骤&问题现象】1、composer require huaweicloud/huaweicloud-sdk-php:3.0.54-rc 安装完成后如下图:1  图:2  代码中的依赖库 sdk 文件加载不上HuaweiCloud\SDK\ 这个文件夹加载不上是哪里没有配置好吗?【截图信息】图:1图:2【日志信息】(可选,上传日志内容或者附件)
  • [MindX SDK] 【mindxsdk】我需要把目标检测后得到的目标框图像放入reid的模型获取图像特征,但是并没有正常工作
    我修改的是安全帽识别的项目:我的pipeline如下所示:{    "Detection":{      "stream_config":{        "deviceId":"0"       },       "mxpi_rtspsrc0":{            "factory":"mxpi_rtspsrc",            "props":{                "rtspUrl":"rtsp://10.254.3.238:8500/ds-test",                "channelId":"0"            },            "next":"queuerstp0"        },        "queuerstp0":{            "props":{                "max-size-buffers":"50"            },            "factory":"queue",            "next":"mxpi_videodecoder0"        },        "mxpi_videodecoder0":{            "factory":"mxpi_videodecoder",            "props":{                "deviceId":"0",                "inputVideoFormat":"H264",                "outputImageFormat":"YUV420SP_NV12",                "vdecChannelId":"0"            },            "next":"queue01"        },        "queue01":{            "props":{                "max-size-buffers":"500"            },            "factory":"queue",            "next":"mxpi_selectedframe0"        },        "mxpi_selectedframe0":{            "factory":"mxpi_selectedframe",            "next":"mxpi_parallel2serial0:0",            "props":{                "frameNum":"1"            }        },        "mxpi_parallel2serial0":{            "factory":"mxpi_parallel2serial",            "props":{                "dataSource":"mxpi_videodecoder0"            },            "next":"mxpi_imageresize0"        },        "mxpi_imageresize0":{            "props":{                "dataSource":"mxpi_parallel2serial0",                "resizeType": "Resizer_KeepAspectRatio_Fit",                "resizeHeight":"640",                "resizeWidth":"640"            },            "factory":"mxpi_imageresize",            "next":"queue0"        },        "queue0":{            "props":{                "max-size-buffers":"500"            },            "factory":"queue",            "next":"mxpi_modelinfer0"        },        "mxpi_modelinfer0":{            "props":{                "dataSource":"mxpi_imageresize0",                "modelPath":"/opt/MindX_SDK/mxVision/wty/yolov5/yolov5_2.0_demo/models/yolov5/yolov5s.om",                "postProcessConfigPath":"/opt/MindX_SDK/mxVision/wty/yolov5/yolov5_2.0_demo/models/yolov5/yolov5.cfg",                "labelPath":"/opt/MindX_SDK/mxVision/wty/yolov5/yolov5_2.0_demo/models/yolov5/label.txt",                "postProcessLibPath":"/opt/MindX_SDK/mxVision-3.0.RC1/lib/libMpYOLOv5PostProcessor.so"            },            "factory":"mxpi_modelinfer",            "next":"mxpi_imagecrop0"        },        "mxpi_imagecrop0":{            "props":{                    "dataSource":"mxpi_modelinfer0",                    "resizeHeight": "256",                    "resizeWidth": "128"            },            "factory":"mxpi_imagecrop",            "next":"mxpi_tensorinfer1"        },        "mxpi_tensorinfer1": {            "props": {                "dataSource": "mxpi_imagecrop0",                "modelPath": "/opt/MindX_SDK/mxVision-3.0.RC1/wty/mindxsdk-referenceapps/contrib/ReID/models/ReID.om"            },            "factory": "mxpi_tensorinfer",            "next": "appsink0"        },        "appsink0": {            "props": {                "blocksize": "4096000"            },            "factory": "appsink"        }    }}报错如下所示:Object detection result of model infer is null!!!W20220728 15:11:05.848527 18989 MxpiImageCrop.cpp:422] [mxpi_imagecrop0][2020][DVPP: image width out of range] The crop width of image No.[0] is out of range [32,4096], actual width is 29. x0(235),y0(22),x1(264),y1(62). Therefore, This box will not be cropped.E20220728 15:11:05.848695 18989 MxpiImageCrop.cpp:590] [mxpi_imagecrop0][2020][DVPP: image width out of range] The crop width of image No.[0] is out of range [32,4096], actual width is 29. x0(235),y0(22),x1(264),y1(62). Therefore, This box will not be cropped.Object detection result of model infer is null!!!W20220728 15:11:05.925478 18989 MxpiImageCrop.cpp:422] [mxpi_imagecrop0][2020][DVPP: image width out of range] The crop width of image No.[0] is out of range [32,4096], actual width is 29. x0(234),y0(21),x1(263),y1(61). Therefore, This box will not be cropped.E20220728 15:11:05.925604 18989 MxpiImageCrop.cpp:590] [mxpi_imagecrop0][2020][DVPP: image width out of range] The crop width of image No.[0] is out of range [32,4096], actual width is 29. x0(234),y0(21),x1(263),y1(61). Therefore, This box will not be cropped.Object detection result of model infer is null!!!W20220728 15:11:06.009892 18989 MxpiImageCrop.cpp:422] [mxpi_imagecrop0][2020][DVPP: image width out of range] The crop width of image No.[0] is out of range [32,4096], actual width is 28. x0(235),y0(22),x1(263),y1(61). Therefore, This box will not be cropped.E20220728 15:11:06.010021 18989 MxpiImageCrop.cpp:590] [mxpi_imagecrop0][2020][DVPP: image width out of range] The crop width of image No.[0] is out of range [32,4096], actual width is 28. x0(235),y0(22),x1(263),y1(61). Therefore, This box will not be cropped.Object detection result of model infer is null!!!W20220728 15:11:06.024123 18989 MxpiImageCrop.cpp:422] [mxpi_imagecrop0][2020][DVPP: image width out of range] The crop width of image No.[0] is out of range [32,4096], actual width is 29. x0(234),y0(22),x1(263),y1(61). Therefore, This box will not be cropped.E20220728 15:11:06.024333 18989 MxpiImageCrop.cpp:590] [mxpi_imagecrop0][2020][DVPP: image width out of range] The crop width of image No.[0] is out of range [32,4096], actual width is 29. x0(234),y0(22),x1(263),y1(61). Therefore, This box will not be cropped.Object detection result of model infer is null!!!W20220728 15:11:06.174964 18989 MxpiImageCrop.cpp:422] [mxpi_imagecrop0][2020][DVPP: image width out of range] The crop width of image No.[0] is out of range [32,4096], actual width is 29. x0(234),y0(22),x1(263),y1(60). Therefore, This box will not be cropped.E20220728 15:11:06.175156 18989 MxpiImageCrop.cpp:590] [mxpi_imagecrop0][2020][DVPP: image width out of range] The crop width of image No.[0] is out of range [32,4096], actual width is 29. x0(234),y0(22),x1(263),y1(60). Therefore, This box will not be cropped.Object detection result of model infer is null!!!W20220728 15:11:06.183930 18989 MxpiImageCrop.cpp:422] [mxpi_imagecrop0][2020][DVPP: image width out of range] The crop width of image No.[0] is out of range [32,4096], actual width is 28. x0(234),y0(22),x1(262),y1(60). Therefore, This box will not be cropped.E20220728 15:11:06.184103 18989 MxpiImageCrop.cpp:590] [mxpi_imagecrop0][2020][DVPP: image width out of range] The crop width of image No.[0] is out of range [32,4096], actual width is 28. x0(234),y0(22),x1(262),y1(60). Therefore, This box will not be cropped.Object detection result of model infer is null!!!W20220728 15:11:06.435464 18989 MxpiImageCrop.cpp:422] [mxpi_imagecrop0][2020][DVPP: image width out of range] The crop width of image No.[0] is out of range [32,4096], actual width is 29. x0(233),y0(21),x1(262),y1(59). Therefore, This box will not be cropped.E20220728 15:11:06.435578 18989 MxpiImageCrop.cpp:590] [mxpi_imagecrop0][2020][DVPP: image width out of range] The crop width of image No.[0] is out of range [32,4096], actual width is 29. x0(233),y0(21),x1(262),y1(59). Therefore, This box will not be cropped.Object detection result of model infer is null!!!W20220728 15:11:06.518703 18989 MxpiImageCrop.cpp:422] [mxpi_imagecrop0][2020][DVPP: image width out of range] The crop width of image No.[0] is out of range [32,4096], actual width is 28. x0(233),y0(21),x1(261),y1(58). Therefore, This box will not be cropped.E20220728 15:11:06.518829 18989 MxpiImageCrop.cpp:590] [mxpi_imagecrop0][2020][DVPP: image width out of range] The crop width of image No.[0] is out of range [32,4096], actual width is 28. x0(233),y0(21),x1(261),y1(58). Therefore, This box will not be cropped.Object detection result of model infer is null!!!W20220728 15:11:06.602635 18989 MxpiImageCrop.cpp:422] [mxpi_imagecrop0][2020][DVPP: image width out of range] The crop width of image No.[0] is out of range [32,4096], actual width is 28. x0(233),y0(21),x1(261),y1(58). Therefore, This box will not be cropped.E20220728 15:11:06.602766 18989 MxpiImageCrop.cpp:590] [mxpi_imagecrop0][2020][DVPP: image width out of range] The crop width of image No.[0] is out of range [32,4096], actual width is 28. x0(233),y0(21),x1(261),y1(58). Therefore, This box will not be cropped.Object detection result of model infer is null!!!W20220728 15:11:10.635695 18989 MxpiImageCrop.cpp:432] [mxpi_imagecrop0][2021][DVPP: image height out of range] The crop height of image is out of range [6,4096], actual height is 4294967248. x0(0),y0(528),x1(213),y1(480). Therefore, This box will not be cropped.W20220728 15:11:13.109241 18989 MxpiImageCrop.cpp:432] [mxpi_imagecrop0][2021][DVPP: image height out of range] The crop height of image is out of range [6,4096], actual height is 4294967200. x0(259),y0(576),x1(323),y1(480). Therefore, This box will not be cropped.W20220728 15:11:13.179190 18989 MxpiImageCrop.cpp:432] [mxpi_imagecrop0][2021][DVPP: image height out of range] The crop height of image is out of range [6,4096], actual height is 4294967200. x0(258),y0(576),x1(320),y1(480). Therefore, This box will not be cropped.W20220728 15:11:14.122613 18989 MxpiImageCrop.cpp:432] [mxpi_imagecrop0][2021][DVPP: image height out of range] The crop height of image is out of range [6,4096], actual height is 4294967291. x0(251),y0(485),x1(296),y1(480). Therefore, This box will not be cropped.W20220728 15:11:14.352444 18989 MxpiImageCrop.cpp:432] [mxpi_imagecrop0][2021][DVPP: image height out of range] The crop height of image is out of range [6,4096], actual height is 4294967292. x0(249),y0(484),x1(292),y1(480). Therefore, This box will not be cropped.W20220728 15:11:16.110862 18989 MxpiImageCrop.cpp:422] [mxpi_imagecrop0][2020][DVPP: image width out of range] The crop width of image No.[0] is out of range [32,4096], actual width is 31. x0(238),y0(22),x1(269),y1(65). Therefore, This box will not be cropped.W20220728 15:11:16.111092 18989 MxpiImageCrop.cpp:422] [mxpi_imagecrop0][2020][DVPP: image width out of range] The crop width of image No.[0] is out of range [32,4096], actual width is 31. x0(238),y0(22),x1(269),y1(65). Therefore, This box will not be cropped.[mxpi_imagecrop0][2020][DVPP: image width out of range] The crop width of image No.[1] is out of range [32,4096], actual width is 19. x0(621),y0(590),x1(640),y1(480). Therefore, This box will not be cropped.W20220728 15:11:16.111219 18989 MxpiImageCrop.cpp:422] [mxpi_imagecrop0][2020][DVPP: image width out of range] The crop width of image No.[0] is out of range [32,4096], actual width is 31. x0(238),y0(22),x1(269),y1(65). Therefore, This box will not be cropped.[mxpi_imagecrop0][2020][DVPP: image width out of range] The crop width of image No.[1] is out of range [32,4096], actual width is 19. x0(621),y0(590),x1(640),y1(480). Therefore, This box will not be cropped.[mxpi_imagecrop0][2020][DVPP: image width out of range] The crop width of image No.[2] is out of range [32,4096], actual width is 12. x0(0),y0(590),x1(12),y1(480). Therefore, This box will not be cropped.E20220728 15:11:16.111304 18989 MxpiImageCrop.cpp:590] [mxpi_imagecrop0][2020][DVPP: image width out of range] The crop width of image No.[0] is out of range [32,4096], actual width is 31. x0(238),y0(22),x1(269),y1(65). Therefore, This box will not be cropped.[mxpi_imagecrop0][2020][DVPP: image width out of range] The crop width of image No.[1] is out of range [32,4096], actual width is 19. x0(621),y0(590),x1(640),y1(480). Therefore, This box will not be cropped.[mxpi_imagecrop0][2020][DVPP: image width out of range] The crop width of image No.[2] is out of range [32,4096], actual width is 12. x0(0),y0(590),x1(12),y1(480). Therefore, This box will not be cropped.我需要您的帮助,请尽快回复,谢谢