当前位置:网站首页>Run yolov3 on Huawei modelarts_ coco_ detection_ dynamic_ AIPP sample
Run yolov3 on Huawei modelarts_ coco_ detection_ dynamic_ AIPP sample
2022-07-19 10:01:00 【Flower boy】
One 、 Reference material
YOLOV3_coco_detection_dynamic_AIPP Examples
stay Atlas 200DK Experience DVPP(2)DVPP、AIPP and OM Reasoning
Two 、 Key steps
2.1 Download source code
official :samples
Blogger :samples
2.2 Download pre training model
wget https://modelzoo-train-atc.obs.cn-north-4.myhuaweicloud.com/003_Atc_Models/AE/ATC%20Model/Yolov3/yolov3.caffemodel
wget https://modelzoo-train-atc.obs.cn-north-4.myhuaweicloud.com/003_Atc_Models/AE/ATC%20Model/Yolov3/yolov3.prototxt
Project directory
samples/cplusplus/level2_simple_inference/2_object_detection/YOLOV3_coco_detection_dynamic_AIPP
2.3 download AIPP The configuration file
wget https://c7xcode.obs.cn-north-4.myhuaweicloud.com/models/YOLOV3_coco_detection_dynamic_AIPP/aipp_objectdetection.cfg
aipp_objectdetection.cfg file
aipp_op {
aipp_mode : dynamic
related_input_rank : 0
max_src_image_size: 700000
support_rotation: false
}
2.4 Set the environment variable
source ~/Ascend/ascend-toolkit/set_env.sh
export INSTALL_DIR=/home/ma-user/Ascend/ascend-toolkit/latest/arm64-linux
export THIRDPART_PATH=/home/ma-user/work/samples
export CPU_ARCH=aarch64
2.5 atc Model transformation
[[email protected] model]$ atc --model=./yolov3.prototxt --weight=./yolov3.caffemodel --framework=0 --output=./yolov3 --soc_version=Ascend910 --insert_op_conf=./aipp_objectdetection.cfg
ATC start working now, please wait for a moment.
ATC run success, welcome to the next use.
2.6 modify CMakeLists.txt
add to opencv Static link library ,cmake build Compilation can be linked to opencv.
# OpenCV_DIR Directory contains OpenCVConfig.cmake
set(OpenCV_DIR /home/ma-user/work/opencv-4.5.1/lib/cmake/opencv4)
# find opencv library
find_package(OpenCV REQUIRED)
# If the package has been found, several variables will
# be set, you can find the full list with descriptions
# in the OpenCVConfig.cmake file.
# Print some message showing some of them
if(${OPENCV_FOUND})
message(STATUS "OpenCV version: ${OpenCV_VERSION}")
message(STATUS "OpenCV include path: ${OpenCV_INCLUDE_DIRS}")
message(STATUS "OpenCV libraries: ${OpenCV_LIBS}")
endif()
# Add OpenCV headers location to your include paths
include_directories(${OpenCV_INCLUDE_DIRS})
2.7 sample_build.sh
[[email protected] scripts]$ ./sample_build.sh
ScriptPath: /home/ma-user/work/samples/cplusplus/level2_simple_inference/2_object_detection/YOLOV3_coco_detection_dynamic_AIPP/scripts
ModelPath: /home/ma-user/work/samples/cplusplus/level2_simple_inference/2_object_detection/YOLOV3_coco_detection_dynamic_AIPP/scripts/../model
[INFO] Sample preparation
please input TargetKernel? [arm/x86]:arm
[INFO] input is normal, start preparation.
--2022-07-05 18:00:01-- https://c7xcode.obs.cn-north-4.myhuaweicloud.com/models/YOLOV3_coco_detection_dynamic_AIPP/dog1_1024_683.jpg
Resolving proxy-notebook.modelarts.com (proxy-notebook.modelarts.com)... 192.168.0.62
Connecting to proxy-notebook.modelarts.com (proxy-notebook.modelarts.com)|192.168.0.62|:8083... connected.
Proxy request sent, awaiting response... 200 OK
Length: 35635 (35K) [image/jpeg]
Saving to: '/home/ma-user/work/samples/cplusplus/level2_simple_inference/2_object_detection/YOLOV3_coco_detection_dynamic_AIPP/scripts/../model/../data/dog1_1024_683.jpg'
/home/ma-user/work/samples/cplusp 100%[============================================================>] 34.80K --.-KB/s in 0.02s
2022-07-05 18:00:02 (1.61 MB/s) - '/home/ma-user/work/samples/cplusplus/level2_simple_inference/2_object_detection/YOLOV3_coco_detection_dynamic_AIPP/scripts/../model/../data/dog1_1024_683.jpg' saved [35635/35635]
[INFO] The yolov3.om already exists.start buiding
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/g++
-- Check for working CXX compiler: /usr/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenCV: /home/ma-user/work/opencv-4.5.1 (found version "4.5.2")
-- OpenCV version: 4.5.2
-- OpenCV include path: /home/ma-user/work/opencv-4.5.1/include/opencv4
-- OpenCV libraries: opencv_calib3d;opencv_core;opencv_dnn;opencv_features2d;opencv_flann;opencv_gapi;opencv_highgui;opencv_imgcodecs;opencv_imgproc;opencv_ml;opencv_objdetect;opencv_photo;opencv_stitching;opencv_video;opencv_videoio
arm architecture detected
target aarch64 300
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ma-user/work/samples/cplusplus/level2_simple_inference/2_object_detection/YOLOV3_coco_detection_dynamic_AIPP/build/intermediates/host
Scanning dependencies of target main
[ 12%] Building CXX object CMakeFiles/main.dir/utils.cpp.o
[ 25%] Building CXX object CMakeFiles/main.dir/model_process.cpp.o
[ 37%] Building CXX object CMakeFiles/main.dir/object_detect.cpp.o
/home/ma-user/work/samples/cplusplus/level2_simple_inference/2_object_detection/YOLOV3_coco_detection_dynamic_AIPP/src/object_detect.cpp: In member function 'void* ObjectDetect::GetInferenceOutputItem(uint32_t&, aclmdlDataset*, uint32_t)':
/home/ma-user/work/samples/cplusplus/level2_simple_inference/2_object_detection/YOLOV3_coco_detection_dynamic_AIPP/src/object_detect.cpp:431:56: warning: 'uint32_t aclGetDataBufferSize(const aclDataBuffer*)' is deprecated: aclGetDataBufferSize is deprecated, use aclGetDataBufferSizeV2 instead [-Wdeprecated-declarations]
size_t bufferSize = aclGetDataBufferSize(dataBuffer);
^
In file included from /home/ma-user/Ascend/ascend-toolkit/latest/arm64-linux/acllib/include/acl/acl_rt.h:16:0,
from /home/ma-user/Ascend/ascend-toolkit/latest/arm64-linux/acllib/include/acl/acl.h:14,
from /home/ma-user/work/samples/cplusplus/level2_simple_inference/2_object_detection/YOLOV3_coco_detection_dynamic_AIPP/src/../inc/utils.h:24,
from /home/ma-user/work/samples/cplusplus/level2_simple_inference/2_object_detection/YOLOV3_coco_detection_dynamic_AIPP/src/../inc/object_detect.h:20,
from /home/ma-user/work/samples/cplusplus/level2_simple_inference/2_object_detection/YOLOV3_coco_detection_dynamic_AIPP/src/object_detect.cpp:19:
/home/ma-user/Ascend/ascend-toolkit/latest/arm64-linux/acllib/include/acl/acl_base.h:276:30: note: declared here
ACL_FUNC_VISIBILITY uint32_t aclGetDataBufferSize(const aclDataBuffer *dataBuffer);
^~~~~~~~~~~~~~~~~~~~
[ 50%] Building CXX object CMakeFiles/main.dir/dvpp_process.cpp.o
[ 62%] Building CXX object CMakeFiles/main.dir/dvpp_resize.cpp.o
[ 75%] Building CXX object CMakeFiles/main.dir/dvpp_jpegd.cpp.o
[ 87%] Building CXX object CMakeFiles/main.dir/main.cpp.o
[100%] Linking CXX executable /home/ma-user/work/samples/cplusplus/level2_simple_inference/2_object_detection/YOLOV3_coco_detection_dynamic_AIPP/out/main
[100%] Built target main
[INFO] Sample preparation is complete

2.8 sample_run.sh
[[email protected] scripts]$ ./sample_run.sh
[INFO] The sample starts to run
[INFO] acl init success
[INFO] open device 0 success
[INFO] create context success
[INFO] create stream success
[INFO] load model ../model/yolov3.om success
[INFO] create model description success
[INFO] create model output success
[INFO] dvpp init resource ok
[INFO] convert image success
[WARN] Input size verify failed input[0] size: 700000, provide size : 259584
[INFO] model execute success
110 116 929 600 dog99%
[INFO] Process pic ../data/dog1_1024_683.jpg by dvpp success
[WARN] Input size verify failed input[0] size: 700000, provide size : 519168
[INFO] model execute success
120 118 925 596 dog99%
[INFO] Process pic ../data/dog1_1024_683.jpg by OpenCV success
[INFO] Execute sample success
[INFO] unload model success, modelId is 1
[INFO] end to destroy stream
[INFO] end to destroy context
[INFO] end to reset device is 0
[INFO] end to finalize acl
[INFO] The program runs successfully, please view the result file in the /home/ma-user/work/samples/cplusplus/level2_simple_inference/2_object_detection/YOLOV3_coco_detection_dynamic_AIPP/scripts/../out/output directory!

2.9 design sketch


边栏推荐
- Chapter 13 set/ multiset of STL
- [C language] summary of function knowledge points
- 华为无线设备配置静态负载均衡
- 光辉使用输出
- CLWY权限管理(三)--- 用户组模块
- Experiment 1: camera calibration experiment using Matlab toolbox
- 纳米银颗粒负载UiO-66|Fe3O4/Cu3(BTC)2金属有机骨架(MOF)纳米复合材料|NaGdF4:Yb,Er上转换纳米粒子@ZIF-8
- 硫化铜纳米粒/ZIF-8复合材料([email protected]载体)|UiO-66/CoSO复合材料|ZIF-67纳米晶表面修饰六咪唑环三磷腈
- 第4章-一阶多智体系统一致性 -> 连续时间含时延系统一致性【程序代码】
- 第4章-一阶多智体系统一致性 -> 切换拓扑系统一致性
猜你喜欢

CLWY权限管理(一)--- 项目搭建

Huawei wireless devices are configured with static load balancing

氨基的金属-有机骨架材料Fe-MOF,Fe-MIL-88NH2|Zr基金属-有机骨架催化剂(Pt-UiO-66)|齐岳生物

第1周学习:深度学习入门和pytorch基础
[email protected]@ZIF67纳米材料"/>氮杂环分子改性UiO-66-NH2|聚乙烯亚胺改性UiO-66-NH2|[email protected]@ZIF67纳米材料

【摸鱼神器】UI库秒变低代码工具——表单篇(二)子控件

18、shell脚本编程(1)

第4章-一阶多智体系统一致性 -> 领航跟随系统一致性

rhcsa 第一天 7.11

Duilib implements tooltip custom mouse prompt window
随机推荐
vim诡异的未知函数0
标准化、归一化和正则化的关系
[565. Array nesting]
Rhcsa jour 2 7,15
TLS四次握手
Browser story
Chapter 4 - first order multi-agent system consistency - > switching topology system consistency [program code]
实验1:使用Matlab工具箱进行相机标定实验
Flink入门到实战-阶段四(时间和窗口图解)
mof定制产品|N-K2Ti4O9/g-C3N4/UiO-66三元复合材料|纸基Au-AgInSe2-ZIF-8纳米复合材料
Rocky基础之正则表达式
2022-07-16: what is the output of the following go language code? A:[]; B:[5]; C:[5 0 0 0 0]; D:[0 0 0 0 0]。 package main imp
mof定制材料|NH(2)-UiO66/rGO氧化石墨烯纳米复合材料|负载亚甲基蓝的ZIF-90纳米粒子
NPM usage
水下机器人ROV和AUV
[C language] storage of floating-point type in memory
[fishing artifact] UI library second low code tool - form part (II) sub control
Chapter 4 - consistency of first-order multi-agent systems - > consistency of continuous time systems with time delays
node+express搭建服务器环境
Mux256to1v,Hadd,Fadd