Views
No views yet
1#class
2fire
3smokeultralytics library installed, which is used for YOLO models:pip install ultralytics1from ultralytics import YOLO
2
3# Load the model
4model = YOLO("./firedetect-11s.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 scores