SuriRaja commited on
Commit
0882703
·
1 Parent(s): 2483ba3

Update services/thermal_service.py

Browse files
Files changed (1) hide show
  1. services/thermal_service.py +2 -3
services/thermal_service.py CHANGED
@@ -3,12 +3,11 @@
3
  import cv2
4
  from transformers import pipeline
5
 
6
- # Use DETR model for thermal detection as well
7
  thermal_detector = pipeline("object-detection", model="facebook/detr-resnet-50")
8
 
9
  def detect_thermal_anomalies(image_path):
10
- image = cv2.imread(image_path)
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: