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
| Command | Description |
| Get Classification Result | Writes 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 Results | Writes the probability of every class as JSON. |
Settings
| Setting | Description |
| Target Class | The 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
| Field | Type | Value |
| Class Name | Text | Name of the most probable class. |
| Confidence (%) | Number | Confidence of that class, 0 to 100. |
| Is Match | Digital | True when the class equals the Target Class at or above the threshold. |
| Output (JSON Text) | Text | Array 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 }
]