diff --git a/examples/YOLOv8-OpenCV-int8-tflite-Python/main.py b/examples/YOLOv8-OpenCV-int8-tflite-Python/main.py index 0a08756bd4..1e3a8e99e9 100644 --- a/examples/YOLOv8-OpenCV-int8-tflite-Python/main.py +++ b/examples/YOLOv8-OpenCV-int8-tflite-Python/main.py @@ -258,7 +258,8 @@ class Yolov8TFLite: img_data = img_data.transpose((0, 2, 3, 1)) scale, zero_point = input_details[0]["quantization"] - interpreter.set_tensor(input_details[0]["index"], img_data) + img_data_int8 = (img_data / scale + zero_point).astype(np.int8) + interpreter.set_tensor(input_details[0]["index"], img_data_int8) # Run inference interpreter.invoke()