Fix for ValueError (expected type INT8) (#13341)

pull/13357/head
czy10383 6 months ago committed by GitHub
parent 5df2d167a9
commit cf081c4db7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3
      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()

Loading…
Cancel
Save