DeepStack-NodeJS Guide

Official NodeJS Guide for DeepStack AI Server

DeepStack is an AI server that empowers every developer in the world to easily build state-of-the-art AI systems both on premise and in the cloud. The promises of Artificial Intelligence are huge but becoming a machine learning engineer is hard. DeepStack is device and language agnostic. You can run it on Windows, Mac OS, Linux, Raspberry PI and use it with any programming language.

Top Features

Example Code

Using DeepStack, we can classify the scene of the above image as seen below

const request = require("request")
const fs = require("fs")
image_stream = fs.createReadStream("image.jpg")
var form = {"image":image_stream}
request.post({url:"http://localhost:80/v1/vision/scene", formData:form},function(err,res,body){
response = JSON.parse(body)
console.log(response)
})

Response

{ success: true, label: 'highway', confidence: 0.63377846 }

You simply send in an image by POST and DeepStack returns a JSON response detailing the label of the image as well as the confidence of the prediction on a scale of 0 - 1

DeepStack is developed and maintained by DeepQuest AI

Installation

DeepStack is available in three variants, CPU Version, GPU Version and Raspberry PI Version (With Support for Intel Neural Compute Stick)

Instructions for installation of the CPU Version is in the next section.

Installing DeepStack - CPU Version

DeepStack can be installed on Linux, Mac and Windows via docker. On windows, DeepStack can also be installed as a standalone Windows App.

If you are on Windows, you can Skip to Option 2 : Installing on Windows

Step 1: Install Docker (If not already installed)

sudo apt-get update
sudo apt-get install curl
curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh

Mac OS and Windows Users can install docker from Docker's Website

Step 2: Install DeepStack

Recommended
Legacy CPU Version
sudo docker pull deepquestai/deepstack
sudo docker pull deepquestai/deepstack:noavx

If you are running an old system without modern cpu instructions such as AVX, please use the Legacy CPU Version

Step 3: Run DeepStack

sudo docker run -e VISION-SCENE=True -v localstorage:/datastore -p 80:5000 deepquestai/deepstack

Basic Parameters

-e VISION-SCENE=True This enables the scene recognition API, all apis are disabled by default.

-v localstorage:/datastore This specifies the local volume where DeepStack will store all data.

-p 80:5000 This makes DeepStack accessible via port 80 of the machine.

Activate DeepStack

The first time you run DeepStack, you need to activate it following the process below.

Once you initiate the run command above, visit localhost:80 in your browser. The interface below will appear.

Get an activation key from DeepStack.cc , paste it in the box and click Activate Now. Once activated, the interface below will appear.

Once installed, run the example scene recognition code to verify your installation is working

Option 2 : Installing DeepStack on Windows

Step 1: Download the DeepStack Installer

Step 2: Run the downloaded Installer

Step 3: Start DeepStack

DeepStack Windows provides a very friendly GUI, you can launch it from the Desktop or the Start Menu,

The interface below will appear when launched.

Click Start Server and, Select the Scene API and click Start Now on the interface that appears next.

Once started, you should activate DeepStack following instructions in Activate DeepStack

After activation, you can run the Example Code to test your installation