Spaces:
Runtime error
Runtime error
Update services/thermal_service.py
Browse files
services/thermal_service.py
CHANGED
|
@@ -1,9 +1,6 @@
|
|
| 1 |
-
import numpy as np
|
| 2 |
import cv2
|
| 3 |
|
| 4 |
-
# Simulate thermal anomaly by analyzing red channel brightness
|
| 5 |
def detect_thermal_anomalies(image_path):
|
| 6 |
-
|
| 7 |
-
red_channel =
|
| 8 |
-
|
| 9 |
-
return avg_temp > 180 # Simulate overheat detection (like >75°C)
|
|
|
|
|
|
|
| 1 |
import cv2
|
| 2 |
|
|
|
|
| 3 |
def detect_thermal_anomalies(image_path):
|
| 4 |
+
img = cv2.imread(image_path)
|
| 5 |
+
red_channel = img[:, :, 2]
|
| 6 |
+
return red_channel.mean() > 180
|
|
|