Deploy Your AI
NOTE: This version of the documentation is for installation of Xailient SDK using wheel file (.wh). If you are looking for documentation for installion of Xailient SDK using SDK package, please visit our old documentation.
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
For ARM32, we have tested on the following device:
- RaspberryPi 3B+
Minimum software requirements:
- Glibc 2.27
- Pip for python3.7
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.
$ sudo apt-get install python3.7
Install pip for python3.7
$ sudo apt-get install python3-pip
$ sudo apt-get install python-opencv
$ sudo apt-get install curl
$ 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
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 copy the SDK link.
Install SDK Wheel
(env) $ python3.7 -m pip install "<SDK WHEEL URL>"
NOTE: Replace <SDK WHEEL URL> 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_samples.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_samples.py script to include the value for BEST THRESHOLD as found above.
Now run the sample script.
(env) $ cd ../samples (env) $ python3.7 basic_samples.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 install "<SDK WHEEL URL>"
When you install a new SDK with a different model using pip install, you do not need to run the licence activation script again.
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.