Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This page provides instructions for building the Vitis-AI Library (v1.3.2) sample applications from source on a ZCU10x evaluation board or KV260 kit running Certified Ubuntu 20.04 LTS for Xilinx Devices.

Info

This flow has been tested with the Ubuntu 22.04 image on the ZCU102 using Vitis AI 2.5. Changes are noted in the steps below.

Table of Contents

Table of Contents
minLevel1
maxLevel7
excludeTable of Contents

...

Code Block
$ sudo apt -y update
$ sudo apt -y install libopencv-dev
$ sudo apt -y install libgoogle-glog-dev

For Ubuntu 22.04, the following additional packages are required:

Code Block
$ sudo apt -y install vitis-ai-library
$ sudo apt -y install libjson-c-dev

Get the Source Code

All of the source code is available on the Xilinx GitHub. After you clone the Vitis AI repository, switch to the v1.3.2 tag. Make sure you’re in your home directory before cloning.

Code Block
$ cd ~
$ git clone https://github.com/Xilinx/Vitis-AI.git
$ cd Vitis-AI
$ git checkout tags/v1.3.2
Info

For Vitis AI 2.5, use tags/v2.5

Build the Application Code

...

Code Block
$ cd demo/Vitis-AI-Library/samples/facedetect
$ ./build.sh
Info

For Vitis AI 2.5, the build directory is examples/Vitis-AI-Library/samples/facedetect

Download a Model

The sample applications require a compatible machine learning model in order to run. Refer to the readme file in the application directory to determine which models are compatible with each sample application. The models are available for download at http://xilinx.com as part of the Xilinx Model Zoo. To find download link for the model you need, use the table below:

...

Code Block
$ wget https://www.xilinx.com/bin/public/openDownload?filename=densebox_640_360-zcu102_zcu104-r1.3.1.tar.gz -O ~/densebox_640_360-zcu102_zcu104-r1.3.1.tar.gz
$ tar -xzf ~/densebox_640_360-zcu102_zcu104-r1.3.1.tar.gz -C ~
Info

For Vitis AI 2.5, the model filename is: densebox_640_360-zcu102_zcu104_kv260-r2.5.0.tar.gz

Run the Sample Application

...

There are three ways to specify the model

  1. Place the model directory in /usr/share/vitis_ai_libray/models/ and use the model name (ex: densebox_640_360)

  2. Place the model directory in the current directory and use the model name

  3. Directly reference the .xmodel file (shown above)

Info

For more information about the specific test applications supported for each sample, please refer to the readme in the demo/Vitis-AI-Library/samples/<sample app> directory

For more information about running the sample apps, please refer to https://github.com/Xilinx/Vitis-AI/blob/master/toolssrc/Vitis-AI-Library/README.md#running-vitis-ai-library-examples

Sample Images and Videos

Vitis AI provides a test image archive that can be download to the target and used to run the tests above. To download the sample image package, and extract them to the samples directory in your home directory, use the following commands: 

Code Block
wget https://www.xilinx.com/bin/public/openDownload?filename=vitis_ai_library_r1.3.1_images.tar.gz -O ~/vitis_ai_library_r1.3.1_images.tar.gz
tar -xzf vitis_ai_library_r1.3.1_images.tar.gz
Info

For Vitis AI 2.5, use the following filename: vitis_ai_library_r2.5.0_images.tar.gz

To use these images and file lists, change into the subdirectory of the test you want to run, and execute the test app from there.  For example, to use the facedetect sample images, you should run your test from the ~/samples/facedetect directory. 

...