Add object detection, tracking, mobile notifications, and search to any security camera.
show score in results
roryclear4535828b5ecf
diff --git a/clearcam.py b/clearcam.pyindex 6f72430..ef435ae 100644--- a/clearcam.py+++ b/clearcam.py@@ -791,6 +791,7 @@ class HLSRequestHandler(BaseHTTPRequestHandler):image_data = []for path_str, score in results:if score < 0.21: break+ print("rory score =",score)img_path = (self.base_dir.parent.parent / Path(path_str)).resolve()ts = int(img_path.stem.split('_')[0])parts = img_path.parts@@ -803,7 +804,8 @@ class HLSRequestHandler(BaseHTTPRequestHandler):"timestamp": ts,"filename": img_path.name,"cam_name": cam,- "folder": img_path.parts[-2]+ "folder": img_path.parts[-2],+ "score": score,})response_data = {"images": image_data,@@ -1189,7 +1191,7 @@ class HLSRequestHandler(BaseHTTPRequestHandler):"timestamp": ts,"filename": img.name,"cam_name": camera_dir.name,- "folder": selected_dir+ "folder": selected_dir,})image_data.sort(key=lambda x: x["timestamp"], reverse=True)diff --git a/mainview.html b/mainview.htmlindex 4009dbe..da321eb 100644--- a/mainview.html+++ b/mainview.html@@ -2972,18 +2972,21 @@previousEventImages = data;const container = document.getElementById("eventImagesContainer");-+if (data.images && data.images.length > 0) {let html = '';- data.images.forEach(img => {+ [...data.images].forEach(img => {const timeStr = secondsToTimeString(img.timestamp);+ const scoreHtml = typeof img.score === 'number' ? ` | Match: ${img.score.toFixed(2)}` : '';html += `<div class="event-image-item"><img src="${img.url}" alt="Event" loading="lazy"onclick="viewImage('${img.url}')"><div class="event-image-info"><strong>${img.cam_name || 'Camera'}</strong><br>- <small>${img.folder} ${timeStr}</small>+ <small>+ ${img.folder} ${secondsToTimeString(img.timestamp)}${scoreHtml}+ </small></div><div class="event-image-actions"><button title="Search Similar"