当前位置:网站首页>Shengteng experience officer Episode 5 notes I

Shengteng experience officer Episode 5 notes I

2022-07-07 14:40:00 Hua Weiyun

First , The goal of the experience is Universal target detection , The code is here .
By viewing the code documentation , Know shengteng AI The processor PCIe Working mode of , Yes RC and EP Pattern . If PCIe Working in main mode , Can extend peripherals , It is called a RC Pattern ; If PCIe Working in slave mode , It is called a EP Pattern .
In a nutshell , Main mode (RC Pattern ) It's the whole package of shengteng processor ,CPU It did the work ,AI It also did the work .
From the mode, there are still CPU Do it CPU Own work .
The difference between the two , The following figure is very clear

image.png

There is another one CANN chart , You can also have a look at . That we use a lot ACL, It's on top .

image.png


Next, let's look at data preprocessing , Of this example Data entry type Can support pic video rtsp.

Model Enter the picture encoding format Input image resolution
Image detection reasoning model be based on onnx Of yolov3 Model BGR416*416
Vehicle color classification reasoning model be based on tensorflow Of CNN Model RGB224*224

Then the input image required by this model , There will be a gap with the input pictures we usually give ( Format and resolution rate ), The process of dealing with the gap is pretreatment .

Pretreatment process :

  1. Because it is batch processing pictures , First open the folder where the pictures are stored OpenPicsDir
  2. Then read in the picture ReadPic . For different picture types , Adopt different reading strategies , such as ReadJpeg and ReadPng The reading of the file itself is the same code , It is only the parsing of meta information of read file data , Use different methods :acldvppJpegGetImageInfo and acldvppPngGetImageInfo
  3. Then decompress it to the original format and zoom it ProcessPic , For example, decompress it to YUV420SP_U8 Formatted data . It uses AclLite Class in AclLiteImageProc Of JpegD Method .AclLite It's right ACL Further encapsulation , Don't follow the details inside , You can go to Reference here .
    • Then zoom (reisze) To change the resolution , It uses AclLite Class in AclLiteImageProc Of ProportionPasteCenter Method , You need to give the target width and height . It's a bit of a mess …
原网站

版权声明
本文为[Hua Weiyun]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207071235115235.html