Spaces:
Runtime error
Runtime error
from ultralytics import YOLO | |
fault_model = YOLO("pole_fault_model.pt") | |
def detect_pole_faults(image_path): | |
results = fault_model(image_path) | |
flagged = [] | |
for r in results: | |
if hasattr(r, 'fault_type') and r.conf > 0.6: | |
flagged.append({"fault_type": r.fault_type, "confidence": r.conf}) | |
return flagged |