Step-by-step tutorial on creating your private AI APIs on the cloud.
The quest to build smarter applications and software systems has never been as paramount as it is in this era, where emerging technologies like Artificial Intelligence becomes a major differentiating factor between digital products that win the market and those that emerge and vanish like a “whales tail”. With the powerful functionalities of AI to recognize human faces, locate and identify objects in pictures, translate human languages effectively, understood human speech and generate new ones, AI integration will be a must have feature for every app and software system by the start of the next decade.
Most developers do not have the theoretical and technical skill to easily integrate AI into their code base due to the complex and time-consuming learning curve. On the other hand, APIs on the cloud are the most developer friendly options to integrate advance features into their code base using any programming language of their choice. With a number of companies providing AI APIs on the cloud, most developers opt for integrating AI using the cloud.
In this article, we will show you how you can setup your own AI API on your private cloud server with:
- Zero API cost, irrespective of the thousands or millions of request you make.
- 100% data privacy.
DeepStack is a AI API server that provides state-of-the-art AI APIs such as Face Detection and Recognition, Persons and Object Detection, Scene Recognition and support for creating new APIs to recognize new set of objects using your custom Tensorflow, Keras and ONNX models. DeepStack is available for Windows, Linux, MacOS and Docker. With DeepStack installed on your local or cloud machine, you can easily integrate AI APIs into your apps and software at 98% the traditional cost and with 100% privacy.
We will be installing the Docker version on an Ubuntu server hosted on DigitalOcean. Please note that you can install DeepStack on any cloud computing platform that you use.
It is a 4-step process. Let’s get started.
Step 1 — Create an Ubuntu Server
Go to the DigitalOcean account dashboard , click the “Create” button on the top right and select “Droplets”.
Select “Ubuntu” as your droplet Image, select a pricing, select a data center and click the “Create” button at the bottom of the page.
Once the server is fully created and ready, DigitalOcean will send you an email with the root username and password to access your newly created Ubuntu server. Once you have the login details from your email, click on the 3-dots in front of the name of your Ubuntu server and select “Access Console”.
Once the console opens, enter your login details and follow the instructions to reset your Ubuntu server password.
Step 2 — Install DeepStack using Docker
Once your Ubuntu server is ready after the password reset, type and run the following commands in the console to install Docker and DeepStack.
- sudo apt-get update
- sudo apt-get install curl
- curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh
- sudo docker pull deepquestai/deepstack
Please note that the first 3 commands is for installing Docker while the 4th is for installing DeepStack on your Ubuntu server through Docker. Once DeepStack is installed on your Ubuntu server, run the command below to start DeepStack with object detection API on.
- sudo docker run -e VISION-DETECTION=True -v localstorage:/datastore -p 80:5000 deepquestai/deepstack
Step 3 — Activate your DeepStack AI API Server
Now that your DeepStack AI API server is on, copy the IP Address of your Ubuntu server (as seen in example server showed in the picture below) and visit the address on your browser.
Once you load the IP Address of your Ubuntu Server, you will be welcomed with Dashboard of your newly created AI Server as seen below.
You will need to get an activation key to activate all AI APIs on your Ubuntu server. You can get a key on Free, Standard and Business plan depending on the APIs you want to activate. Visit the website DeepStack website and
- create an account
- select a plan
- copy your activation key from your DeepStack account.
Once you have your activation key, go to your Ubuntu server tab and paste the key in the input space provided. Then click the “Activate Now” button.
VOILA! Your private Cloud AI API server is now fully functional. See the next step on using your Cloud AI API.
Step 4 — Test and Using your private Cloud AI API
Now that your private Cloud AI API server is setup, you can connect to your APIs via the IP Address of your Ubuntu server from any mobile, web and software code base using any programming language of your choice. In the example below, we have a sample codes that we will use to connect to our Cloud AI API and perform persons and object detection on a sample picture.
Sample Python code
Sample NodeJS code
Sample C# code
- Detection Result -
Using the x_min, y_min, x_max and y_max coordinates of each objects in the JSON result, you can count all the objects, extract each object as a separate image or draw boxes around each object.
We have provided a comprehensive Dev Center with documentations and sample codes to fully utilize your private Cloud AI API. Visit the DeepStack Dev Center via the link below.
You can learn more about using DeepStack via the links below.