Spaces:
Runtime error
Runtime error
File size: 579 Bytes
2ab31cf |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
from PIL import Image
import numpy as np
class ThermalService:
def detect_hotspots(self, image, detection_service, confidence_threshold):
"""Detect overheating in thermal images."""
# For demo, assume DETR detects 'hotspot' (requires fine-tuning)
detections = detection_service.detect_objects(image, confidence_threshold)
# Placeholder: Filter for thermal-specific labels (e.g., 'hotspot')
thermal_detections = [
d for d in detections if d["label"] in ["hotspot", "overheating"]
]
return thermal_detections |