Add object detection, tracking, mobile notifications, and search to any security camera.
mask does something
roryclear4cb4dafb7ea3
diff --git a/clearcam.py b/clearcam.pyindex 787e1d3..43629f0 100644--- a/clearcam.py+++ b/clearcam.py@@ -588,7 +588,12 @@ class VideoCapture:for x in online_targets:if x.tracklet_len < 1: continue # dont alert for 1 frame, too many false positivesif hasattr(self, "mask") and self.mask is not None:- print("obj =",x.tlwh,"mask =",self.mask[0])+ #print("mask and tlwh =",self.mask,x.tlwh)+ if x.tlwh[0]>(self.mask[0][0]+self.mask[0][2]) or x.tlwh[1]>(self.mask[0][0]+self.mask[0][3]) or\+ (x.tlwh[0]+x.tlwh[2])<self.mask[0][0] or (x.tlwh[1]+x.tlwh[3])<self.mask[0][1]:+ #print("skipped")+ continue+ #print("detected")preds.append(np.array([x.tlwh[0],x.tlwh[1],(x.tlwh[0]+x.tlwh[2]),(x.tlwh[1]+x.tlwh[3]),x.score,x.class_id]))if int(x.track_id) not in self.object_set and (classes is None or str(int(x.class_id)) in classes):self.object_set.add(int(x.track_id))