Solutions

ML Classification Example

2min

Overview

Document image


Running the application using the downloaded Tar File

  1. After Checkout, 2 tar.gz files, and one zip are expected to be downloaded
    1. motionModel.zip contains the ML classification model PB file
    2. ml-classification.tar.gz is a docker container that runs training and test data for verification of model
    3. helper-bundle.zip is an optional zip file which has:
      1. A system template that can be used for a quick setup of the demo
      2. Some meta data about the model (like input tensor, output tensor names etc) just for reference
      3. There is a Tengoscript code as well, incase the model output needs further modification
  2. Log in to your LitmusEdge, Navigate to Analytics -> Models. Upload the motionModel.zip file here (do not unzip it before uploading)
  3. Navigate to DH or Analytics or Flows, and add a topic called subscribeTopic. This is used a subscription topic for Nats messages, and will be used to keep tracking of polling intervals (keep polling interval 1s)
  4. Navigate to Applications -> Images and Click on the Plus icon "Upload Image" and upload the ml-classification.tar.gz file here
  5. Navigate to Applications -> Containers and enter the following command there:
    1. run the command docker run us-docker.pkg.dev/litmus-customer-facing/litmus-solutions/ml-classification:1.0.0 (or replace with whatever image:tag name you have
    2. This will start the container that published training/test data to various topics, that we will use for feeding to the ML model
  6. Navigate to System -> Backup/Restore -> Upload Template, and upload the classification-template.jsonthat should be in the helper bundle
    1. This should load Analytics with all the required inputs, load the Tensorflow processor with all parameters, and also add a TengoScripting processor with some additional (optional) modification of model output
    2. If this step fails for some reason, just use the Meta and TengoScript file as a reference to re-create the above (just connect inputs to Tensorflow, and modify configurations accordingly)
  7. Once Tensorflow ingests required amount of values, the output data will start populating. It may take some time (depending on the window value parameter). One is expected to see array of values, which shows classification as walking, standing, sitting, etc.