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-26m.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(yolo26m)
2mAP50 0.956607
3mAP50-95 0.644568
4precision 0.925281
5recall 0.901577