Get Started

Prepare your Raspberry PI for the first time to run exciting AI Models in minutes!

Items required:

  • XaLogic K210 Accelerator
  • Raspberry PI (Any version with a standard 40 pins header)
  • Internet Connection

Step 1: Raspberry Pi Configuration

It is recommended that you start with a fresh installation of the Raspberry PI OS. The instructions on this page are based on the Raspberry PI OS 32-bits (Desktop).
We recommend the use of the Raspberry PI Imaging tool (https://www.raspberrypi.org/blog/raspberry-pi-imager-imaging-utility).

   

Once you have installed the Raspberry PI OS,  run the Raspberry PI Config tool and select the following settings.
Preferences -> Raspberry Pi Configuration

Camera, SPI, I2C and Serial Port must be enabled.
It is important that Serial console is disabled as it interferes with our UART port.
You will need to reboot after this step.

 

Step 2: Install OpenCV

You can skip this step if you already have OpenCV on your Raspberry PI .

These instructions are tested on a fresh Raspberry PI 32-bit OS (Desktop) installation.

Note: Installation of OpenCV in a Virtual Environment is not supported at the moment.

Install Dependencies:

sudo apt-get update
sudo apt-get install libhdf5-dev libhdf5-serial-dev libhdf5-103
sudo apt-get install libqtgui4 libqtwebkit4 libqt4-test python3-pyqt5
sudo apt-get install libatlas-base-dev
sudo apt-get install libjasper-dev

Install OpenCV using PIP3:

pip3 install opencv-contrib-python==4.1.0.25

 

Step3: Get XaLogic Software

We have created a single package that contains all the sample codes, libraries, and tools you need to create AI applications with just a few lines of code.
To create your own applications, look at rundemo.py and make modifications from there.

Free Models Available:

  • Face5 - Face detection with 5 landmarks.
  • MaskNoMask - Detection of a face and identifying if a mask is worn.
  • Many more free models to come!!!

 

Clone the source code

You need to clone this repository to get all that you need to start creating cool projects.

git clone --recurse-submodules https://github.com/xalogic-open/xaccel.git 

Install the SPI Drivers

To communicate with the XaLogic K212 Accelerator Hat, you need to install a custom SPI driver.

cd xaccel/py-spidev
sudo make all PYTHON=python3 
sudo make install PYTHON=python3
cd ..

 

Once you have installed the SPI drivers, you can now run the runmodel.py script that will allow you to program the XaLogic K210 AI Accelerator Hat with the correct model and runs a demo on it.

Demo: Face with 5 Landmark Features

python3 runmodel.py --model=face5

For subsequent runs of the same models, you don't need to reload the models and you can run the following to speed up the initialization

python3 runmodel.py --model=face5 --noupdate

Demo: Mask or NoMask

python3 runmodel.py --model=masknomask

For subsequent runs of the same models, you don't need to reload the models and you can run the following to speed up the initialization

python3 runmodel.py --model=masknomask--noupdate