Objective of this Tutorial

This tutorial describes compilation (in Vitis 2023.2 and Petalinux 2023.2. of AI 3.0 models for inference acceleration on AMD DPUCZDX8G for Trenz Electronic Zynq Ultrascale+ systems with AMD Vitis 2023.2 and Petalinux 2023.2 for Trenz Electronic modules and evaluation boards with AMD Zynw Ultrascale+ devices.

The AMD DPUCZDX8G engine in Vitis 2022.2 is unchanged in Vitis 2023.2.
Project serving for integration of the AMD DPUCZDX8G engine is present in Vitis-AI 3.0 repository. 

Creation of an extensible platform and integration of the AMD AI 3.0 DPUCZDX8G is described for the family of TE0820 modules in related Tutorial:

The trained AI models are also unchanged and present in the AMD Vitis-AI 3.0 repository.

However, the AMD AI sample application SW source code compatible with Petalinux 2023.2 AI runtime libraries is present only in the Vitis-AI 3.5 repository.

That is why we need to download and use both AMD Vitis AI packages: Vitis-AI 3.0 and Vitis-AI 3.5.

Install packages

Install Vitis AI 3.0

Download the Vitis-AI 3.0 repository.

In browser, open page:

https://github.com/Xilinx/Vitis-AI/tree/3.0

Click on green Code button and download Vitis-AI-3.0.zip file.
Unzip to

~/work/Vitis-AI-3.0

The directory contains the Vitis-AI 3.0 framework.

Download the Vitis-AI 3.5 repository.

In browser, open page:

https://github.com/Xilinx/Vitis-AI/tree/master

Click on green Code button and download Vitis-AI-master.zip file.
Unzip to

~/work/Vitis-AI-3.5

The directory contains the Vitis-AI 3.5 framework.

Starting point for exploration of these Vitis AI 3.5 examples is this Xilinx www page.

https://xilinx.github.io/Vitis-AI/3.0/html/index.html

Vitis AI 3.0 Images and Videos

Download the AI 3.0 support archive archive with images:

https://www.xilinx.com/bin/public/openDownload?filename=vitis_ai_library_r3.0.0_images.tar.gz

Download the AI 3.0 support archive with videos:

https://www.xilinx.com/bin/public/openDownload?filename=vitis_ai_library_r3.0.0_video.tar.gz

Unzip and untar content to:

~/apps 
~/samples
~/samples_onnx

These directories contain images and videos for AI 3.0 examples. Copy content to:

~/work/Vitis-AI-3.5/examples/vai_library/apps
~/work/Vitis-AI-3.5/examples/vai_library/samples
~/work/Vitis-AI-3.5/examples/vai_library/samples_onnx

Install Docker

In Ubuntu 20.04, install docker 

sudo apt install docker.io

 Test the docker installation: 

sudo docker run hello-world

Install Docker Images for Vitis AI 3.5

Install precompiled docker images 

sudo docker pull xilinx/vitis-ai-tensorflow-cpu:latest
sudo docker pull xilinx/vitis-ai-tensorflow2-cpu:latest
sudo docker pull xilinx/vitis-ai-pytorch-cpu:latest

Version 3.5 is latest. It is suitable for compilation of models for the installed Vitis AI 3.0 DPU.

Vitis AI 3.0 Model Downloads

Python Downloader

Vitis AI 3.0 models can be downloaded with python tool downloader.py

cd ~/work/Vitis-AI-3.0/model_zoo

Example:

Select pytorch model framework

input: pt
Select model (pt_resnet50_imagenet_224_224_0.4_4.9G_3.0)

input num: 1

chose model (all)

Input num: 0

devel@ubuntu:~/work/Vitis-AI-3.0/model_zoo$ python3 downloader.py
Tip:
you need to input framework and model name, use space divide such as tf vgg16
tf:tensorflow1.x  tf2:tensorflow2.x  cf:caffe  dk:darknet  pt:pytorch  all: list all model
input:pt
chose model
0 : all
1 : pt_resnet50_imagenet_224_224_0.4_4.9G_3.0
2 : pt_face-mask-detection_512_512_0.67G_3.0
3 : pt_inceptionv3_imagenet_299_299_0.5_5.7G_3.0
4 : pt_yolov5-large_coco_640_640_109.6G_3.0
5 : pt_fadnet_sceneflow_576_960_0.65_154G_3.0
6 : pt_psmnet_sceneflow_576_960_0.68_696G_3.0
7 : pt_squeezenet_imagenet_224_224_1.12G_3.0
8 : pt_OFA-devel@ubuntu:~/work/Vitis-AI-3.0/model_zoo$ python3 downloader.py
Tip:
you need to input framework and model name, use space divide such as tf vgg16
tf:tensorflow1.x  tf2:tensorflow2.x  cf:caffe  dk:darknet  pt:pytorch  all: list all model
input:pt
chose model
0 : all
1 : pt_resnet50_imagenet_224_224_0.4_4.9G_3.0
2 : pt_face-mask-detection_512_512_0.67G_3.0
3 : pt_inceptionv3_imagenet_299_299_0.5_5.7G_3.0
4 : pt_yolov5-large_coco_640_640_109.6G_3.0
5 : pt_fadnet_sceneflow_576_960_0.65_154G_3.0
6 : pt_psmnet_sceneflow_576_960_0.68_696G_3.0
7 : pt_squeezenet_imagenet_224_224_1.12G_3.0
8 : pt_OFA-resnet50_imagenet_160_160_0.88_1.8G_3.0
9 : pt_yolov6m_coco_640_640_82.4G_3.0
10 : pt_resnet50_imagenet_224_224_0.3_5.8G_3.0
11 : pt_OFA-depthwise-res50_imagenet_176_176_1.29G_3.0
12 : pt_salsanext_semantic-kitti_64_2048_0.6_20.4G_3.0
13 : pt_SOLO_coco_640_640_214G_3.0
14 : pt_resnet50_imagenet_224_224_0.5_4.1G_3.0
15 : pt_vehicle-type-classification_CarBodyStyle_224_224_3.64G_3.0
16 : pt_pmg_grocerystore_224_224_2.28G_3.0
17 : pt_SemanticFPN-mobilenetv2_cityscapes_512_1024_10G_3.0
18 : pt_bert-large_SQuADv1.1_384_246.42G_3.0
19 : pt_salsanextv2_semantic-kitti_64_2048_0.75_33.27G_3.0
20 : pt_inceptionv3_imagenet_299_299_0.6_4.5G_3.0
21 : pt_resnet50_imagenet_224_224_0.7_2.5G_3.0
22 : pt_vehicle-color-classification_VCoR_224_224_3.64G_3.0

23 : pt_inceptionv3_imagenet_299_299_11.4G_3.0
24 : pt_DRUNet_Kvasir_528_608_0.8G_3.0
25 : pt_vehicle-make-classification_VMMR_224_224_3.64G_3.0
26 : pt_OFA-yolo_coco_640_640_0.3_34.72G_3.0
27 : pt_MaskRCNN_coco_800_800_240G_3.0
28 : pt_OFA-resnet50_imagenet_224_224_15.0G_3.0
29 : pt_yolov5s6_coco_1280_1280_17G_3.0
30 : pt_OFA-rcan_DIV2K_360_640_40.5G_3.0
31 : pt_SESR-S_DIV2K_360_640_10.2G_3.0
32 : pt_resnet50_imagenet_224_224_0.6_3.3G_3.0
33 : pt_resnet50_imagenet_224_224_8.2G_3.0
34 : pt_CFLOW_LIDC_128_128_10.42G_3.0
35 : pt_yolox-nano_coco_416_416_1G_3.0
36 : pt_yolov4csp_coco_640_640_121G_3.0
37 : pt_OFA-yolo_coco_640_640_48.88G_3.0
38 : pt_OFA-resnet50_imagenet_192_192_0.74_3.6G_3.0
39 : pt_3D-UNET_kits19_128_128_128_1065.44G_3.0
40 : pt_bert-tiny_SQuADv1.1_384_453M_3.0
41 : pt_xilinxSR_360_640_DIV2K_364.88G_3.0
42 : pt_OFA-resnet50_imagenet_224_224_0.45_8.2G_3.0
43 : pt_inceptionv3_imagenet_299_299_0.3_8G_3.0
44 : pt_OFA-yolo_coco_640_640_0.5_24.62G_3.0
45 : pt_inceptionv3_imagenet_299_299_0.4_6.8G_3.0
46 : pt_movenet_coco_192_192_0.5G_3.0
47 : pt_fadnet_sceneflow_576_960_441G_3.0
48 : pt_ENet_cityscapes_512_1024_11.3G_3.0
49 : pt_fadnetv2_sceneflow_576_960_412G_3.0
50 : pt_SemanticFPN_cityscapes_256_512_10.56G_3.0
51 : pt_fadnetv2_sceneflow_576_960_0.51_201G_3.0
52 : pt_pointpillars_kitti_12000_100_11.2G_3.0
53 : pt_OFA-resnet50_imagenet_224_224_0.60_6.0G_3.0
54 : pt_yolov5-nano_coco_640_640_4.6G_3.0
55 : pt_CLOCs_kitti_3.0
56 : pt_HRNet_cityscapes_1024_2048_378G_3.0
57 : pt_bert-base_SQuADv1.1_384_70.66G_3.0
input num:1
chose model type
0: all
1 : GPU
2 : zcu102 & zcu104 & kv260
3 : vck190
4 : vck5000-DPUCVDX8H-4pe
5 : vck5000-DPUCVDX8H-6pe-aieDWC
6 : vck5000-DPUCVDX8H-6pe-aieMISC
7 : vck5000-DPUCVDX8H-8pe
input num:0
pt_resnet50_imagenet_224_224_0.4_4.9G_3.0.zip
                                              100.0%|100%
resnet50_pruned_0_4_pt-zcu102_zcu104_kv260-r3.0.0.tar.gz
                                              100.0%|100%
resnet50_pruned_0_4_pt-vck190-r3.0.0.tar.gz
                                              100.0%|100%
resnet50_pruned_0_4_pt-vck5000-DPUCVDX8H-4pe-r3.0.0.tar.gz
                                              100.0%|100%
resnet50_pruned_0_4_pt-vck5000-DPUCVDX8H-6pe-aieDWC-r3.0.0.tar.gz
                                              100.0%|100%
resnet50_pruned_0_4_pt-vck5000-DPUCVDX8H-6pe-aieMISC-r3.0.0.tar.gz
                                              100.0%|100%
resnet50_pruned_0_4_pt-vck5000-DPUCVDX8H-8pe-r3.0.0.tar.gz
                                              100.0%|100%
done
devel@ubuntu:~/work/Vitis-AI-3.0/model_zoo$

Delete model packages for other architectures:

./resnet50_pruned_0_4_pt-vck190-r3.0.0.tar.gz
./resnet50_pruned_0_4_pt-vck5000-DPUCVDX8H-4pe-r3.0.0.tar.gz
./resnet50_pruned_0_4_pt-vck5000-DPUCVDX8H-6pe-aieDWC-r3.0.0.tar.gz
./resnet50_pruned_0_4_pt-vck5000-DPUCVDX8H-6pe-aieMISC-r3.0.0.tar.gz
./resnet50_pruned_0_4_pt-vck5000-DPUCVDX8H-8pe-r3.0.0.tar.gz

Models for AMD DPU configuration B4096 are present in:

./resnet50_pruned_0_4_pt-zcu102_zcu104_kv260-r3.0.0.tar.gz

Models for other AMD DPU configurations have to be compiled from data present in zip archive:

./pt_resnet50_imagenet_224_224_0.4_4.9G_3.0.zip

 unzip this archive to directory

./pt_resnet50_imagenet_224_224_0.4_4.9G_3.0

Arch.json File

An arch.json is produced by Vivado in the process of compilation of the AMD DPU.

If we have to use less FPGA resources we can (or we have to) select AMD AI 3.0 DPUCZDX8G in smaller configuration. For example: B1600.  Details of creation of an extensible platform and integration of the AMD AI 3.0 DPUCZDX8G with configuration B1600 is described for the family of TE0820 modules in related Tutorial:

The corresponding arch.json file describing the AMD AI 3.0 DPUCZDX8G in B1600 configuration have been created in:

~/work/te0820_23_240/test_board_dpu_trd/dpu_trd_system_hw_link/Hardware/dpu.build/link/vivado/vpl/prj/prj.gen/sources_1/bd/zusys/ip/zusys_DPUCZDX8G_1_0/arch.json

Copy that arch.json file for the AMD AI 3.0 DPUCZDX8G B1600 configuration to:

~/work/Vitis-AI-3.0/model_zoo/arch.json

Compile Pytorch Models

Copy fie compile_model.sh from the repository associated to this application note to the directory

~/work/Vitis-AI-3.0/model_zoo/compile_model.sh

 Change mode to executable for file compile_model.sh

Chmod +x ~/work/Vitis-AI- 3.0/model_zoo/compile_model.sh

Compile First Pytorch Model for AMD DPU in B1600 Configuration

Change directory to

~/work/Vitis-AI-3.0

Start pytorch docker

sudo ./docker_run.sh xilinx/vitis-ai-pytorch-cpu:latest

In pytorch docker WorkFlow, change directory to model_zoo

cd model_zoo

Start pytorch compiler framework

conda activate vitis-ai-pytorch

Parameters for model compilation script compile_model.sh :

  1. pt                                                                            pytorch model
  2. resnet50_pruned_0_4_pt                                            Model name
  3. pt_resnet50_imagenet_224_224_0.4_4.9G_3.0               Directory
  4. ResNet_0_int.xmodel                                                Quantized model

Pytorch model is indicated by pt

Model name can be found in the readme file in classification directory:

/home/devel/work/Vitis-AI-3.0/examples/vai_library/samples/classification/readme

Part of classification/readme file content   

Valid model name:
    …
    resnet50_pruned_0_4_pt
    …

Directory is name of the unzipped directory associated to the model

Quantized model is name of file <name>. xmodel located in directory associated to the model in subdirectory quantized

/work/Vitis-AI- 3.0/model_zoo/pt_resnet50_imagenet_224_224_0.4_4.9G_3.0/quantized/ResNet_0_int.xmodel

This file name <name> can be different for different models but the location alvais in the subdirectory quantized and the extension is alvais .xmodel

Command for compilation of pytorch model:

./compile_model.sh pt resnet50_pruned_0_4_pt pt_resnet50_imagenet_224_224_0.4_4.9G_3.0 ResNet_0_int.xmodel

Compilation listing:

(vitis-ai-pytorch) vitis-ai-user@ubuntu:/workspace/model_zoo$ ./compile_model.sh pt resnet50_pruned_0_4_pt pt_resnet50_imagenet_224_224_0.4_4.9G_3.0 ResNet_0_int.xmodel
**************************************************
* VITIS_AI Compilation - Xilinx Inc.
**************************************************
[UNILOG][INFO] Compile mode: dpu
[UNILOG][INFO] Debug mode: null
[UNILOG][INFO] Target architecture: DPUCZDX8G_ISA1_B1600
[UNILOG][INFO] Graph name: ResNet_0, with op num: 417
[UNILOG][INFO] Begin to compile...
[UNILOG][INFO] Total device subgraph number 3, DPU subgraph number 1
[UNILOG][INFO] Compile done.
[UNILOG][INFO] The meta json is saved to "/workspace/model_zoo/./compiled_output_pt/resnet50_pruned_0_4_pt/meta.json"
[UNILOG][INFO] The compiled xmodel is saved to "/workspace/model_zoo/./compiled_output_pt/resnet50_pruned_0_4_pt/resnet50_pruned_0_4_pt.xmodel"
[UNILOG][INFO] The compiled xmodel's md5sum is 8977ac80ac31133b9a957c20d55643d4, and has been saved to "/workspace/model_zoo/./compiled_output_pt/resnet50_pruned_0_4_pt/md5sum.txt"
(vitis-ai-pytorch) vitis-ai-user@ubuntu:/workspace/model_zoo$

Directory compiled_output_pt is created. It contains compiled model files for the AMD DPU in configuration B1600 in the directory resnet50_pruned_0_4_pt

./compiled_output_pt/resnet50_pruned_0_4_pt

One file is needed in the compiled model. File is present in archive with precompiled model for the AMD DPU in B4096 configurations.

Open archive

resnet50_pruned_0_4_pt-zcu102_zcu104_kv260-r3.0.0.tar.gz

copy file

resnet50_pruned_0_4_pt/resnet50_pruned_0_4_pt.prototxt

to file

./compiled_output_pt/resnet50_pruned_0_4_pt/resnet50_pruned_0_4_pt.prototxt

General classification Model: pt_resnet50_imagenet_224_224_0.4_4.9G_3.0 is compiled for AMD DPU in B1600 configuration. It contains 4 files:

~/work/Vitis-AI-3.0/model_zoo/compiled_output_pt/resnet50_pruned_0_4_pt/md5sum.txt
~/work/Vitis-AI-3.0/model_zoo/compiled_output_pt/resnet50_pruned_0_4_pt/meta.json
~/work/Vitis-AI-3.0/model_zoo/compiled_output_pt/resnet50_pruned_0_4_pt/resnet50_pruned_0_4_pt.xmodel
~/work/Vitis-AI-3.0/model_zoo/compiled_output_pt/resnet50_pruned_0_4_pt/ resnet50_pruned_0_4_pt.prototxt

Compile Other Pytorch Models for AMD DPU in B1600 configuration

Perform similar compilation steps for other 9 selected models:

Face detection Model: 
pt_face-mask-detection_512_512_0.67G_3.0

Vehicle make Model: 
pt_vehicle-make-classification_VMMR_224_224_3.64G_3.0
Vehicle type Model: 
pt_vehicle-type-classification_CarBodyStyle_224_224_3.64G_3.0

Vehicle color Model: 
pt_vehicle-color-classification_VCoR_224_224_3.64G_3.0
General classification Model: 
pt_resnet50_imagenet_224_224_8.2G_3.0
General classification Model: 
pt_resnet50_imagenet_224_224_0.3_5.8G_3.0
General classification Model: 
pt_resnet50_imagenet_224_224_0.4_4.9G_3.0 (allready compiled)
General classification Model: 
pt_resnet50_imagenet_224_224_0.5_4.1G_3.0
General classification Model: 
pt_resnet50_imagenet_224_224_0.6_3.3G_3.0
General classification Model: 
pt_resnet50_imagenet_224_224_0.7_2.5G_3.0

Find the expected model names in sample application readme files:

~/work/Vitis-AI-3.0/examples/vai_library/samples/yolov4/readme
~/work/Vitis-AI-3.0/examples/vai_library/samples/vehicleclassification/readme
~/work/Vitis-AI-3.0/examples/vai_library/samples/classification/readme


Result of compilations is folder (with all 10 model subfolders targeting the AMD DPU in B1600 configuration)

./compiled_output_pt/*

Compres it as .zip file. It will be used to target Vitis AI 3.0 demos on system with AMD DPU configuration B1600

Copy this archive into directory indicating the AMD DPU configuration like:

~/work/B1600/compiled_output_pt.zip

Delete directory

~/work/Vitis-AI-3.0/model_zoo/compiled_output_pt/*

Compile Pytorch Models for other AMD DPU Configurations

To target other systems, the integration of the DPU has to be repeated and the resulted new arch.json describing the AMD DPU configuration has to be replaced. Copy the arch.json file for the selected AMD DPU configuration to

~/work/Vitis-AI-3.0/model_zoo/arch.json

Repeat:

  • Compilation for system, AMD DPU in B0512 configuration will be created.
  • Compilation for system, AMD DPU in B1024 configuration will be created.
  • Compilation for system, AMD DPU in B1600 configuration will be created.
  • In case of the AMD DPU in B4096 configuration all needed files are present in the download packages archives for zcu102_zcu104_kv260

To target tested system use .zip archive:

~/work/B4096/compiled_output_pt.zip


Sample Vitis AI 3.5 applications

Demos from the Vitis AI 3.5 library can be compiled in Vitis 2023.2 for Petalinux 2023.2 run-time on the test boards.  Demos can use models from the Vitis AI 3.0 library for the DPU HW with different sizes of the DPUs defined in Vitis AI 3.0. This is possible due to unchanged internal structure of these DPUs.

SW examples from the Vitis AI 3.5 package to be moved to the target system are: 

~/work/Vitis-AI-3.5/examples/vai_library/samples/yolov4
~/work/Vitis-AI-3.5/examples/vai_library/samples/vehicleclassification
~/work/Vitis-AI-3.5/examples/vai_library/samples/classification

 Compress them to:

~/work/yolov4.zip
~/work/vehicleclassification.zip
~/work/classification.zip

Archives to be moved to the target system:

~/work/B4096/compiled_output_pt.zip
~/work/yolov4.zip
~/work/vehicleclassification.zip
~/work/classification.zip

Compile Tensorflow Models

Process of compilation models is similar to pytorch model. Change directory to: 

~/work/Vitis-AI-3.0

 Start tensorflow docker

sudo ./docker_run.sh xilinx/vitis-ai-tensorflow-cpu:latest

In tensorflow docker WorkFlow, change directory to model_zoo

cd model_zoo

Start tensorflow compiler framework

conda activate vitis-ai-tensorflow

There are only 3 parameters for model compilation script compile model.sh :

  1. tf tensorflow model
  2. Model name
  3. Directory

The tensorflow model is indicated by tf

Model name can be found in the readme file in the sample application.

Directory is name of the unzipped directory associated to the model.

 Compile Tensorflow2 Models

Process of compilation models is similar to pytorch model. Change directory to:

~/work/Vitis-AI-3.0

 

 Start tensorflow docker 

sudo ./docker_run.sh xilinx/vitis-ai-tensorflow2-cpu:latest

In tensorflow docker WorkFlow, change directory to model_zoo

cd model_zoo

Start tensorflow2 compiler framework

conda activate vitis-ai-tensorflow2

There are only 3 parameters for model compilation script compile model.sh :

  1. tf2 tensorflow2 model
  2. Model name
  3. Directory

Tensorflow2 model is indicated by tf2

Model name can be found in the readme file in the sample application.

Directory is name of the unzipped directory associated to the model.


Test Sample Vitis AI 3.5 Applications

Install Archives on Systems with Petalinux 2023.2

Use ssh to copy Vitis AI 3.5 examples from PC :

~/work/yolov4.zip
~/work/vehicleclassification.zip
~/work/classification.zip

to edge evaluation board

~/yolov4.zip
~/vehicleclassification.zip
~/classification.zip

Use ssh to copy compiled Vitis 3.0 model archives from PC:

~/work/B0512/compiled_output_pt.zip
~/work/B1024/compiled_output_pt.zip
~/work/B1600/compiled_output_pt.zip
~/work/B4096/compiled_output_pt.zip

To edge evaluation board

~/B0512/compiled_output_pt.zip
~/B1024/compiled_output_pt.zip
~/B1600/compiled_output_pt.zip
~/B4096/compiled_output_pt.zip

On target board, unzip Vitis AI 3.5 sample applications from

~/yolov4.zip
~/vehicleclassification.zip
~/classification.zip

to:

~/yolov4
~/vehicleclassification
~/classification

On target board, copy models from the relevant directory:

<config> = B4096

From:

~/<config>/compiled_output_pt/face_mask_detection_pt

to:

~/yolov4/face_mask_detection_pt

From:

~/<config>/compiled_output_pt/vehicle_make_resnet18_pt
~/<config>/compiled_output_pt/vehicle_type_resnet18_pt

to:

~/vehicleclassification/vehicle_make_resnet18_pt
~/vehicleclassification/vehicle_type_resnet18_pt

From:

~/<config>/compiled_output_pt/chen_color_resnet18_pt
~/<config>/compiled_output_pt/resnet50_pt
~/<config>/compiled_output_pt/resnet50_pruned_0_3_pt
~/<config>/compiled_output_pt/resnet50_pruned_0_4_pt
~/<config>/compiled_output_pt/resnet50_pruned_0_5_pt
~/<config>/compiled_output_pt/resnet50_pruned_0_6_pt
~/<config>/compiled_output_pt/resnet50_pruned_0_7_pt

to:

~/classification/chen_color_resnet18_pt
~/classification/resnet50_pt
~/classification/resnet50_pruned_0_3_pt
~/classification/resnet50_pruned_0_4_pt
~/classification/resnet50_pruned_0_5_pt
~/classification/resnet50_pruned_0_6_pt
~/classification/resnet50_pruned_0_7_pt

Compile Vitis AI 3.5 Applications on Systems

On target board, compile all sample applications:

cd ~/yolov4
chmod +x build.sh
./build,sh
cd ~/vehicleclassification
chmod +x build.sh
./build,sh
cd ~/classification
chmod +x build.sh
./build,sh

Export Path to the DPU

Use export command:

export XLNX_VART_FIRMWARE=/run/media/mmcblk1p1/dpu.xclbin


Test Vitis AI 3.5 Application on Systems

Test Vitis AI 3.5 applications with commands described in sample application readme files:

~/work/Vitis-AI-3.5/examples/vai_library/samples/yolov4/readme
~/work/Vitis-AI-3.5/
examples/vai_library/samples/vehicleclassification/readme
~/work/Vitis-AI-3.0/examples/vai_library/samples/classification/readme

 Change directory to

~/yolov4

Test face mask detection with input from file sample_face_mask.jpg

./test_jpeg_yolov4 face_mask_detection_pt sample_face_mask.jpg

Output: face mask detection coordinates on terminal.

 Test performance of face mask detection with input from files listed in test_performance_face_mask.list file.

./test_performance_yolov4 face_mask_detection_pt  test_performance_face_mask.list -s 60 -t 3

Output: data about performance (in FPS) of face mask detection on terminal.

-s 60    defines length of benchmark in seconds.

-t 3       defines use of 3 SW threads (with one AMD DPU)

 Test face mask detection with USB www camera input

./test_video_yolov4 face_mask_detection_pt 0 -t 1

 

Face mask detection Vitis AI 3.0 application with camera input, DPU: B4096, system.


Output: Video output with face mask coordinates in video and performance (in FPS) displayed as text in video.


0         defines USB www camera device number

-t 1    defines use of 1 SW thread

Face mask detection Vitis AI 3.0 application can be stopped by pointing mouse to the X11 window with video output and typing Esc key on the keyboard.

Other Vitis AI 3.5 Applications on Systems

Vitis AI 3.5 sample test applications located in the directory ~/vehicleclassification have analogical format for calling and parameters.

Two different AI models can be used to classify make or type of the vehicle.

Vitis AI 3.5 sample test applications located in the directory ~/classification have analogic format.

Several different AI 3.0 models can be used to

  • Classify color of vehicle,
  • Classify objects with original model
  • Classify objects with model, pruned by factor of 0.3, 0.4, 0.5, 0.6 or 0.7, have gradually reduced complexity and potentially reduced classification quality.

Measured Vitis AI 3.5 Performance on Systems

  • Performance in frames per second [FPS],
  • Power consumption in [W],
  • End to end performance in (int8) Giga operations per second [GOPs].

TE0820-03-04EV-1E-2GB module, ID=23, TE0701-06, DPU: B4096

Vitis AI 3.0 examples

Performance with input from camera e2e

[FPS]

Power with camera and VGA

[W]

Performance  input from file e2e

(-t 3)

[FPS]

Power with input from file e2e (-t 3)

[W]

GigaOps

input from file e2e (-t 3)

[Gops]

Face detection  Model: pt_face-mask-detection_512_512_0.67G_3.0

30.0

10.0

1139.8 75.7

Vehicle make  Model: pt_vehicle-make-classification_VMMR_224_224_3.64G_3.0

30.010.516713.6607.9

Vehicle type  Model: pt_vehicle-type-classification_CarBodyStyle_224_224_3.64G_3.0

30.010.516713.6607.9

Vehicle color Model: pt_vehicle-color-classification_VCoR_224_224_3.64G_3.0

30.010.516713.6488.7

General classification Model: pt_resnet50_imagenet_224_224_8.2G_3.0

30.011.9

59.6

13.0

401.3

General classification Model: pt_resnet50_imagenet_224_224_0.3_5.8G_3.0

30.011.5

69.2

12.7

361.6

General classification Model: pt_resnet50_imagenet_224_224_0.4_4.9G_3.0

30.011.2

73.8

12.4

332.5

General classification Model: pt_resnet50_imagenet_224_224_0.5_4.1G_3.0

30.011.0

81.1

12.2

332.5

General classification Model: pt_resnet50_imagenet_224_224_0.6_3.3G_3.0

30.010.7

91.1

11.9

300.6

General classification Model: pt_resnet50_imagenet_224_224_0.7_2.5G_3.0

30.010.6

99.6

11.5

249.0

Measurement conditions:

  • TE0820-03-04EV-1EA 2GB module with 12V FAN on TE0701-06 carrier board
  • DPU in B4096 configuration
  • USB WWW colour camera logi 720p, Logitech, 1280x720p30, 30 FPS
  • Remote X11 desktop
  • Power supply 12V/5A
  • Power measured at the 230V power plug

OIder Vitis AI Versions

Not available


Table of contents