A confidence score is a model-produced value indicating estimated certainty for a particular prediction or detection. In object detection, scores range from 0 to 1: values near 1 indicate greater certainty, while values near 0 indicate less. section 8.1.7
Reading detection confidence
During manual inspection of a driver’s-license image, the model labels the card as a book with confidence 0.28, while a person detection receives 0.79. The contrasting scores expose an incorrect but uncertain classification and a more certain detection. section 8.1.7
Listing 8.15 Running inference with the default Nano model
import glob
import cv2
from ultralytics import YOLO
model = YOLO("yolov8n.pt") #1
for file in glob.glob("samples/**.jpg"): #2
result = model(cv2.imread(file))
res_plotted = result[0].plot() #3
cv2.imshow("result", res_plotted) #4
cv2.waitKey(0)
Run YOLO inference over sample images and inspect plotted detections and their confidence scores. section 8.1.7












