Skip to content

Deploy Your AI

Note

This version of the documentation is for installation of Xailient SDK using wheel file (.whl). If you are looking for documentation for installion of Xailient SDK using SDK package, please visit our old documentation.

If your local machines doesn't meet the requirements for native installation we also offer Docker Containers as a deployment option.

Device Setup

To meet the minimum requirements, your device must be a x86_64 or ARM32 architecture device. We've tested the following operating systems:

  • Ubuntu 18.04 LTS
  • Ubuntu 19.04
  • Raspbian Buster

Note

To run Xailient SDK on Windows or MacOS, please run it inside a VirtualBox.

Here are some resources you can refer to to install Ubuntu operating system on a VirtualBox:

For ARM32, we have tested on the following device:

  • RaspberryPi 3B+

Minimum software requirements:

  • Glibc 2.27
  • Python3.7
  • Pip for python3.7
  • OpenCV
  • Curl
  • VirtualEnv

If your device does not meet the minimum software required, please follow the instructions below to install them.

Download the package lists and update information

$ sudo apt-get update

Note

apt-get update to download the package lists from the repositories and "update" them to get information on the newest versions of packages and their dependencies. It will do this for all repositories and PPAs.

Install python3.7

$ sudo apt-get install python3.7

Install pip for python3.7

$ sudo apt-get install python3-pip

Install OpenCV

$ sudo apt-get install python-opencv

Install Curl

$ sudo apt-get install curl

Install VirtualEnv

$ python3.7 -m pip install --user virtualenv

Create a Virtual Environment (Recommended)

Create a new python virtual environment to isolate package installation for the system.

$ python3 -m venv env

Activate the virtual environment.

Before you can start using the virtual environment for package installations, you will need to activate it. Activating a virtual environment will put the virtual environment-specific python and pip executables into your shell's PATH.

$ source env/bin/activate

To deactivate the virtual environment later,

(env) $ deactivate

Install XailientSDK

Note

In 18.04 Ubuntu, by default pip3 is for python3.6. So we will use python3.7 -m pip command instead to use pip for python3.7. If pip3 for your device defaults to python3.7, feel free to replace the command python3.7 -m pip with pip3.

Get SDK Wheel Link

Go to the Console and navigate to MANAGE AI MODELS. For the model you want to deploy, select the SDK you have build for your target platform.

Note

If you have not build an SDK yet, refer to Build SDK section of the documentation.

Click on the target platform for the model to download and copy the SDK link.

Note

When you click the button <ARM32> or <x86_64>, it downloads the SDK wheel file as well as copies the link to the wheel file in your clipboard.

Install SDK Wheel

Install using downloaded SDK wheel file
(env) $ python3.7 -m pip install <download_path/wheel_file_name>
(env) $ python3.7 -m pip install "<SDK WHEEL LINKs>"

Note

Replace <SDK WHEEL LINK> with the SDK link you copied earlier from the console.

Info about xailient sdk installed

(env) $ python3.7 -m pip show xailient

You can get information about the version of xailient sdk installed, support email address, and location of the installation.

Note

Keep note of the install location "Location" as you will need it in the steps below.

Go to Xailient Installation Folder

To go to xailient folder, use the following command. If you do not know the install location, please refer to "Info about xailient sdk installed" section above.

(env) $ cd <Xailient Install Location>/xailient

Xailient SDK contents

(env) $ ls
  • bin/ -- Executables required for initial registration
  • data/ -- Image files you can use with the sample applications
  • samples/ -- Sample application demonstrating how the Xailient SDK library can be used
  • scripts/ -- License activation scripts
  • sharedLib_x86_64/ --Sample models that can be installed or linked with your applications

Install tflite runtime

Install the tflite runtime using requirements.txt file.

(env) $ python3.7 -m pip install -r requirements.txt

Activate your license

Go to scripts folder and execute xailient-install script

(env) $ cd scripts
(env) $ sudo ./xailient-install

Run sample code

In the xailient folder of the install location, go to samples folder. This folder contains a sample python script named "basic_sample.py" that demonstrates how to use the xailient sdk.

The script reads an image named "beatles.jpg" from data folder, runs the detection sdk on this image and saves output to "beatles_output.jpg" in the same folder.

Before we can run this script, we need to ensure that we give the OPTIMAL THRESHOLD.

Go to the Console, navigate to MANAGE AI MODELS and click on the model which you have installed. Scroll down to Evaluation Results where you can find BEST THRESHOLD.

Then using a text editor of your choice, edit the basic_sample.py script to include the value for BEST THRESHOLD as found above.

Now run the sample script.

(env) $ cd ../samples
(env) $ python3.7 basic_sample.py

Now go to data folder to see the input and output images.

Input Image Output Image

Update Xailient SDK Model

(env) $ python3.7 -m pip uninstall xailient
(env) $ python3.7 -m pip install "<new SDK WHEEL URL>"

When you install a new SDK with a different model using pip install, you do not need to run the license activation script again.

Uninstall Xailient

Go to xailient/scripts folder and run the uninstalltion script.

(env) $ ../scripts
(env) $ sudo ./xailient-uninstall

Pip uninstall xailient

(env) $ python3.7 -m pip uninstall xailient

Keep in mind that after uninstall, the data folder and sample folder will remain. When you install a new SDK with a different model, these folders will be reintegrated into the SDK. This allows users to easily move data and scripts across different SDKs.

Note that any changes to the basic_sample.py python script will be overwritten so keep a backup if you intend to keep any changes.