Abstract:This paper mainly shows how to realize the pedestrian detection Demo jointly developed by ModelArts and Atlas 200 DK terminal cloud.

Based on open source data set, train pedestrian detection model with ModelArts, complete model transformation in local MindStudio, and finally deploy to Atlas 200 DK. Practical skills of end-to-end development from data set to final deployment. The process of developing skills is shown in the figure below:

The picture is from the blog Five Talk Four Beautiful Boys

Environmental preparation:

Virtual machine based on Linux Ubuntu 16.04.3 LTS

Atlas 200 DK

Previously on:

Pedestrian detection uses YOLO3_RESNET18 algorithm of ModelArts. This algorithm has preset algorithm and AI market version, a total of three, should be able to use, the preset algorithm version is used here.

Model training (optional) :

The data set uses the Person category in VOC2007. ModelArts is used to create the data set, and the Person part is screened out. Because it is not convenient to download in OBS (you have to pay according to the number of downloaded files, save some money), you can train according to your own data set. Note that the format of the dataset is VOC2007, which is the image +.xml annotation, as detailed in the ModelArts documentation on the dataset section. From the data and creation to the overall training to the resulting.PB model, please refer to the guide on the blog.

Deployment:

The complete Demo is on the Baidu net disk, and the download link is as follows. After downloading, upload it to Atlas 200 DK and run main.py.

Link: https://pan.baidu.com/s/1UpyEkD40HUwhyFRin6aocQ

Extract code: KC39

The detailed deployment process can be referred to:

1. Copy application code to the development board

I unzipped the downloaded package and put it in the directory home/ scend/ TMP. Here scend is my user name and I want to change it to your own.

Open the terminal on the virtual machine and perform the following command to upload the Demo to the Atlas 200 DK. If this is not clear, please refer to thishttps://bbs.huaweicloud.com/forum/thread-56436-1-1.html:

SCP -r Pedestrain_Detection_YOLOv3_Resnet18_Demo/[email protected]: / home/HwHiAiUser/HIAI_PROJECTS

2. Log in to the development board and execute the program

Here, follow the command above to transfer the Demo to the HIAI_PROJECTS folder, which is where you need to execute the command.

First, log in to the development board, execute the command, remember to enter your password:

SSH [email protected]

I connect to the development board through USB, if you connect to the network cable may be different, it should only be different IP, please login to the development board by yourself.

Next, enter the file and execute the command:

cd HIAI_PROJECTS/Pedestrain_Detection_YOLOv3_Resnet18_Demo/

The following program is executed:

python3 main.py input_video/TownCentreXVID_1920_1080_25.mp4

Python3 is used here, I have tried, Python2 is also OK, but I print out the Chinese is garbled, but it does not affect the result. Note that the terminal print out may have

[ERROR] Run Failed, dowork function failed. It’s all right. Never mind. I printed it myself.

The final result is in the output_image folder and you need to download it to the virtual machine to view it yourself. Execute the command:

SCP - r [email protected]: / home/HwHiAiUser/HIAI_PROJECTS/Pedestrain_Detection_YOLOv3_Resnet18_Demo/output_image /home/ascend/tmp

Okay, now you can go to the TMP folder where the Demo was stored.

I put the picture video was synthesized, the effect is general, some aspects of the video broadcast twice, can have a look, if you also want to synthesize photo video, you can refer to https://bbs.huaweicloud.com/blogs/168952.

Here’s a link to the video:

Link: https://pan.baidu.com/s/1-ZvoHqV1Cr8Su7qnyWKI-g

Extraction code: NNH6

So far, ModelArts and Atlas 200 DK cloud collaborative development —– pedestrian detection Demo has been completed. Is it very simple, please try it soon?

Click on the attention, the first time to understand Huawei cloud fresh technology ~