Get Started
Teachable Machine Classification
On this page
  1. Commands
  2. Settings
  3. Output Variables
  4. JSON Output

Teachable Machine Classification

Classifies the camera video with an image classification model trained in Google Teachable Machine. The model is uploaded in the analyzer settings. Model Path (.tflite) accepts only 224×224 RGB models in TensorFlow Lite format, exported as the Floating Point or Quantized type. Label Path is the labels.txt exported with the model, with one class name per line in order. For the procedure to create a model see Appendix B, External Services.

Commands

CommandDescription
Get Classification ResultWrites the class name and confidence of the most probable class.
Is Specific Class?Checks whether the result matches the Target Class with confidence at or above the threshold.
Get All ResultsWrites the probability of every class as JSON.

Settings

SettingDescription
Target ClassThe class (label) name compared by Is Specific Class?. It must exactly match a name in labels.txt. Example: cat, defect.
Threshold (%)A result counts as matched only when its confidence is at or above this value. 0 to 100, default 50.

Output Variables

FieldTypeValue
Class NameTextName of the most probable class.
Confidence (%)NumberConfidence of that class, 0 to 100.
Is MatchDigitalTrue when the class equals the Target Class at or above the threshold.
Output (JSON Text)TextArray of the probability of every class.

JSON Output

An array with, per class, label and confidence (0 to 100), ordered from the highest probability.

[
  { "label": "apple", "confidence": 92 },
  { "label": "banana", "confidence": 6 },
  { "label": "orange", "confidence": 2 }
]