Spaces:
Build error
Build error
Create thermal_service.py
Browse files- services/thermal_service.py +11 -0
services/thermal_service.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from ultralytics import YOLO
|
| 2 |
+
|
| 3 |
+
thermal_model = YOLO("thermal_model.pt")
|
| 4 |
+
|
| 5 |
+
def detect_thermal_anomalies(image_path):
|
| 6 |
+
results = thermal_model(image_path)
|
| 7 |
+
flagged = []
|
| 8 |
+
for r in results:
|
| 9 |
+
if hasattr(r, 'temperature') and r.temperature > 75:
|
| 10 |
+
flagged.append(r)
|
| 11 |
+
return flagged
|