Run a Starter Application


The starter applications are a quick and easy way to begin using the alwaysAI platform after you set up your development computer.

Download the Starter Applications

To get started, download all of the starter applications (unless you have already done so):

$ aai get-starter-apps

And navigate to the starter app directory of your choice:

$ cd alwaysai-starter-apps/<chosen app>

Configure the Application

You can run your application locally on your computer (if you are running Windows or Linux), or remotely on an edge device.

Please choose a method below:

To install and run the application on your Windows computer, run the following command:

$ aai app install

This command prompts you for your alwaysAI account credentials and then installs the application’s models and a Python virtual environment (venv) into the application directory.


Start the Application

Now start your application with the command:

$ aai app start

The log output from app.py is forwarded through the CLI to your terminal, including the labels that the model has been trained to recognize.

Once the app starts, a log will be printed with the link:

[INFO] Streamer started at http://localhost:5000

Open this URL in a browser to see the video and text data generated by the app.

To stop the application, simply hit CTRL-C.

To deploy an application locally on your development machine running Linux, run the following command:

$ aai app deploy

This command prompts you for your alwaysAI account credentials and the target where you would like the application to run. Select the Your local computer option when prompted.

(The first time you run this command, the “Build docker image” step can take several minutes to download the edgeIQ docker image.)


Start the Application

Now start your application with the command:

$ aai app start

The log output from app.py is forwarded through the CLI to your terminal, including the labels that the model has been trained to recognize.

Once the app starts, a log will be printed with the link:

[INFO] Streamer started at http://localhost:5000

Open this URL in a browser to see the video and text data generated by the app.

To stop the application, simply hit CTRL-C.

To deploy an application from your development machine to your edge device, run the following command:

$ aai app deploy

This command prompts you for your alwaysAI account credentials and the target where you would like the application to run. Select the Remote device option if prompted, then enter the hostname (with optional username — e.g., pi@1.2.3.4) of the target device, the ssh password for the device, and any other necessary information.

(The first time you run this command, the “Build docker image” step can take several minutes to download the edgeIQ docker image.)


Start the Application

Now start your application with the command:

$ aai app start

The log output from app.py is forwarded through the CLI to your terminal, including the labels that the model has been trained to recognize.

Once the app starts, a log will be printed with the link:

[INFO] Streamer started at http://localhost:5000

Open this URL in a browser to see the video and text data generated by the app.

To stop the application, simply hit CTRL-C.

Change the Computer Vision Model

Now that you have an application up and running, you can easily modify it to use a different model and see how it behaves. Explore the alwaysAI Model Catalog to find models that fit your needs. As an example, let’s change the model in the realtime_object_detector starter application.

By default, the realtime_object_detector app uses the alwaysai/MobileNetSSD model which was trained on the Pascal VOC dataset and can detect 20 unique objects. Let’s switch to the alwaysai/ssd_mobilenet_v1_coco_2018_01_28 model, which was trained on the COCO dataset and can detect 100 unique objects.

  1. Add the new model to your application configuration:

$ aai app models add alwaysai/ssd_mobilenet_v1_coco_2018_01_28
  1. Update the ObjectDetection instantiation in app.py to use the new model:

    Replace

    obj_detect = edgeiq.ObjectDetection("alwaysai/mobilenet_ssd")
    

    with

    obj_detect = edgeiq.ObjectDetection("alwaysai/ssd_mobilenet_v1_coco_2018_01_28")
    
  2. Deploy the updated application to your target device.

    To deploy locally on Windows, use the command:

    $ aai app install
    

    To deploy locally on Linux, or to a remote device, use the command:

    $ aai app deploy
    
  3. Start the application:

    $ aai app start
    
  4. (Optional) Remove the old model from your application configuration:

    $ aai app models remove alwaysai/mobilenet_ssd