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.
รูปแบบคำสั่ง
TfliteModel(model)พารามิเตอร์สำหรับสร้างออบเจ็กต์
| ชื่อ | คำอธิบาย |
|---|---|
modelString | Model reference to use for inference (prefer template model name). จำเป็น · ระบุตามตำแหน่งหรือชื่อ ไม่มีค่าเริ่มต้น |
ค่าที่ส่งกลับ
ตัวอย่าง
# ตรวจสอบความพร้อมของโมเดลก่อนรันการตรวจจับ
if TfliteModel.exists("enemy_model"):
detector = TfliteModel("enemy_model")
hits = detector.inference()
if len(hits) > 0:
click(hits[0])ฟิลด์
| ชื่อ | คำอธิบาย |
|---|---|
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. ค่าเริ่มต้น: LETTERBOX |
color_modeString | Resolved preprocessing color mode: RGB, BGR, or GRAYSCALE. ค่าเริ่มต้น: RGB |
norm_modeString | Resolved preprocessing normalization: ZERO_ONE, MINUS_ONE_ONE, IMAGENET, or CUSTOM. ค่าเริ่มต้น: ZERO_ONE |
padding_colorInt | Padding fill value (0 -> 255) used by LETTERBOX resize mode. ค่าเริ่มต้น: 114 |
# นำเข้าโมเดล TFLite ที่รองรับ แล้วเลือกชนิดเอาต์พุตใน Template Manager
# สร้าง model handle ที่ผูกกับชื่อโมเดล TFLite หนึ่งรายการใน Template Manager
model = TfliteModel("enemy_model")