Yolov8 INT8 Tflite output

I created a Yolov8 INT8 as follows:
yolo export model=yolov8n.pt data=coco128.yaml format=tflite int8

I followed the instructions to get the output:

Load the TFLite model

interpreter = tf.lite.Interpreter(model_path=“/content/drive/MyDrive/Model/yolov8n_saved_model/yolov8n_full_integer_quant.tflite”)


Get input and output tensors.

input_details = interpreter.get_input_details()

output_details = interpreter.get_output_details()

Load and preprocess an image

image = Image.open(“/content/dog.jpeg”)

image = image.resize((640, 640)) # Resize to the model’s expected input size

Convert image to INT8 data type

input_data = np.array(image, dtype=np.int8) # Convert image data to INT8

input_data = np.expand_dims(input_data, axis=0) # Add batch dimension

Run inference

interpreter.set_tensor(input_details[0][‘index’], input_data)


Get the output results

output_data = [interpreter.get_tensor(output_details[i][‘index’]) for i in range(len(output_details))]

The shape of my output is:
Output Shape: (1, 84, 8400)

I would like to loop though the data and just print the class and score, not interested in the bounding box. Is there a way to do that ?

Hi @Mark_Russo

Generally, on the Roboflow forum, we only have the capacity to provide support for issues and questions about Roboflow. I think you might get the best answer on places like Stack Overflow about this.