Spaces:
Runtime error
Runtime error
Update services/thermal_service.py
Browse files
services/thermal_service.py
CHANGED
@@ -3,12 +3,11 @@
|
|
3 |
import cv2
|
4 |
from transformers import pipeline
|
5 |
|
6 |
-
#
|
7 |
thermal_detector = pipeline("object-detection", model="facebook/detr-resnet-50")
|
8 |
|
9 |
def detect_thermal_anomalies(image_path):
|
10 |
-
|
11 |
-
results = thermal_detector(image)
|
12 |
|
13 |
thermal_boxes = []
|
14 |
for result in results:
|
|
|
3 |
import cv2
|
4 |
from transformers import pipeline
|
5 |
|
6 |
+
# Load HuggingFace DETR model
|
7 |
thermal_detector = pipeline("object-detection", model="facebook/detr-resnet-50")
|
8 |
|
9 |
def detect_thermal_anomalies(image_path):
|
10 |
+
results = thermal_detector(image_path) # ✅ directly pass path, not NumPy image!
|
|
|
11 |
|
12 |
thermal_boxes = []
|
13 |
for result in results:
|