Add object detection, tracking, mobile notifications, and search to any security camera.
remove cython bbox dep
roryclear600096069290
diff --git a/requirements.txt b/requirements.txtindex a027f5c..504a60b 100644--- a/requirements.txt+++ b/requirements.txt@@ -2,5 +2,4 @@ git+https://github.com/tinygrad/tinygrad.git@3b3de8df61343b65483af43efa70e9de285numpy==2.0.0opencv-python==4.10.0.84scipy==1.14.1-cython_bbox==0.1.5lap\ No newline at end of filediff --git a/yolox/tracker/matching.py b/yolox/tracker/matching.pyindex 2572c4d..ea47c9b 100644--- a/yolox/tracker/matching.py+++ b/yolox/tracker/matching.py@@ -3,8 +3,6 @@ import numpy as npimport scipyimport lapfrom scipy.spatial.distance import cdist--from cython_bbox import bbox_overlaps as bbox_iousfrom yolox.tracker import kalman_filterimport time@@ -69,6 +67,23 @@ def ious(atlbrs, btlbrs):return ious+def bbox_ious(boxes, query_boxes):+ N = boxes.shape[0]+ K = query_boxes.shape[0]++ boxes_area = ((boxes[:, 2] - boxes[:, 0] + 1) * (boxes[:, 3] - boxes[:, 1] + 1)).reshape(N, 1)+ query_areas = ((query_boxes[:, 2] - query_boxes[:, 0] + 1) * (query_boxes[:, 3] - query_boxes[:, 1] + 1)).reshape(1, K)++ ixmin = np.maximum(boxes[:, 0].reshape(N, 1), query_boxes[:, 0].reshape(1, K))+ iymin = np.maximum(boxes[:, 1].reshape(N, 1), query_boxes[:, 1].reshape(1, K))+ ixmax = np.minimum(boxes[:, 2].reshape(N, 1), query_boxes[:, 2].reshape(1, K))+ iymax = np.minimum(boxes[:, 3].reshape(N, 1), query_boxes[:, 3].reshape(1, K))+ iw = np.maximum(ixmax - ixmin + 1, 0)+ ih = np.maximum(iymax - iymin + 1, 0)+ intersection = iw * ih+ union = boxes_area + query_areas - intersection+ overlaps = np.where((iw > 0) & (ih > 0), intersection / union, np.zeros_like(intersection))+ return overlapsdef iou_distance(atracks, btracks):"""