TFLite model handle for scripts. The model type must be selected in Template Manager metadata. Supported outputs are YOLOv8/YOLO11 object detection [1,N,4+C]/[1,4+C,N], YOLO26 end-to-end detection [1,N,6]/[N,6], YOLO11/YOLO26 image classification [1,C], and MobileNetV3 image classification [1,C]. Runtime detects FLOAT32, INT8, or UINT8 tensor precision from the model and dequantizes quantized detection and classification outputs before applying thresholds. Classification matches return class confidence and metadata without point or bounds. Inference methods require a local model file; when local file is missing and runtime download fails, script raises a runtime error.
Syntax
TfliteModel(model)Constructor parameters
| Name | Description |
|---|---|
modelString | Model reference to use for inference (prefer template model name). Required · Positional or named No default |
Returns
Example
# Check model availability before running detection
if TfliteModel.exists("enemy_model"):
detector = TfliteModel("enemy_model")
hits = detector.inference()
if len(hits) > 0:
click(hits[0])Fields
| Name | Description |
|---|---|
modelString | Model reference in current macro (prefer template model name; legacy model id still accepted). |
resize_modeString | Resolved preprocessing resize mode: LETTERBOX, STRETCH, or CROP_CENTER. Default: LETTERBOX |
color_modeString | Resolved preprocessing color mode: RGB, BGR, or GRAYSCALE. Default: RGB |
norm_modeString | Resolved preprocessing normalization: ZERO_ONE, MINUS_ONE_ONE, IMAGENET, or CUSTOM. Default: ZERO_ONE |
padding_colorInt | Padding fill value (0 -> 255) used by LETTERBOX resize mode. Default: 114 |
# Import a supported TFLite model and choose its output type in Template Manager.
# Create a model handle bound to one TFLite model name in Template Manager.
model = TfliteModel("enemy_model")