Add object detection, tracking, mobile notifications, and search to any security camera.
clean
roryclear3fcebad8953e
diff --git a/clearcam.py b/clearcam.pyindex 519bb10..a5780c8 100644--- a/clearcam.py+++ b/clearcam.py@@ -541,7 +541,7 @@ class VideoCapture:def run_inference(self, frame):frame = Tensor(frame)pre = preprocess(frame)- preds = do_inf(pre, yolo_infer)[0].numpy()+ preds = do_inf(pre, yolo_infer).numpy()thresh = (self.settings.get("threshold") if self.settings else 0.5) or 0.5 #todo clean!online_targets = tracker.update(preds, [1280,1280], [1280,1280], thresh) #todo, zone in js also hardcoded to 1280preds = []@@ -1469,5 +1469,4 @@ if __name__ == "__main__":if url:hls_streamer.stop()cam.release()- server.shutdown()-+ server.shutdown()\ No newline at end of filediff --git a/detection/yolov9.py b/detection/yolov9.pyindex ae97b21..fbfece0 100644--- a/detection/yolov9.py+++ b/detection/yolov9.py@@ -373,7 +373,7 @@ class YOLOv9():x = m(x)y.append(x)- return postprocess(x[0])+ return postprocess(x[0])[0]def compute_iou_matrix(boxes):x1s = boxes[:, :, 0]diff --git a/test/test_mot.py b/test/test_mot.pyindex fa3fba3..111077a 100644--- a/test/test_mot.py+++ b/test/test_mot.py@@ -72,7 +72,7 @@ if __name__ == "__main__":im /= 255if len(im.shape) == 3:im = im[None]- pred = do_inf(im, model).numpy()[0]+ pred = do_inf(im, model).numpy()pred[:, :4] = scale_coords(pred[:, :4], ratio, (dw, dh))# no tracker, todo clean#pred = pred[pred[:, 4] >= 0.25]