File size: 395 Bytes
8cb2a57
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import torch

def detect_hotspots(model, image):
    # Perform thermal hotspot detection
    results = model(image)
    hotspots = []

    for detection in results.xywh[0]:
        class_id = int(detection[5].item())
        if class_id == 4:  # Assuming class 4 is for hotspots
            hotspots.append({"type": "Hotspot", "location": (detection[0], detection[1])})
    
    return hotspots