Views
No views yet
1#class
2helmet
3face (no helmet)ultralytics library installed, which is used for YOLO models:pip install ultralytics1from ultralytics import YOLO
2
3# Load the model
4model = YOLO("./helmet-11x.pt")
5
6# Perform detection on an image
7results = model("image.png")
8
9# Display or process the results
10results.show() # This will display the image with detected objects1for result in results:
2 print(result.boxes) # Bounding boxes
3 print(result.names) # Detected classes
4 print(result.scores) # Confidence scores1(yolo11x)
2mAP50 0.958612
3mAP50-95 0.649457
4precision 0.913453
5recall 0.930291