@@ -14,29 +14,29 @@ def __init__(self, opts, frame_rate=30, gamma=0.02, *args, **kwargs) -> None:
1414
1515 self .reid_model = Extractor (opts .reid_model_path , use_cuda = True )
1616 self .gamma = gamma # coef that balance the apperance and iou
17- self .filter_small_area = False # filter area < 50 bboxs
17+ self .filter_small_area = False # filter out the bboxes with an area less than 50
1818
1919 def get_feature (self , tlbrs , ori_img ):
2020 """
2121 get apperance feature of an object
2222 tlbrs: shape (num_of_objects, 4)
2323 ori_img: original image, np.ndarray, shape(H, W, C)
2424 """
25- obj_bbox = []
25+ obj_bboxes = []
2626
2727 for tlbr in tlbrs :
2828 tlbr = list (map (int , tlbr ))
2929 # if any(tlbr_ == -1 for tlbr_ in tlbr):
3030 # print(tlbr)
31- obj_bbox .append (
31+ obj_bboxes .append (
3232 ori_img [tlbr [1 ]: tlbr [3 ], tlbr [0 ]: tlbr [2 ]]
3333 )
3434
35- if obj_bbox : # obj_bbox is not []
36- features = self .reid_model (obj_bbox ) # shape: (num_of_objects, feature_dim)
37-
35+ if obj_bboxes : # obj_bboxes is not []
36+ features = self .reid_model (obj_bboxes ) # shape: (num_of_objects, feature_dim)
3837 else :
3938 features = np .array ([])
39+
4040 return features
4141
4242 def gate_cost_matrix (self , cost_matrix , tracks , dets , max_apperance_thresh = 0.15 , gated_cost = 1e5 , only_position = False ):
@@ -160,7 +160,6 @@ def update(self, det_results, ori_img):
160160 refind_stracks .append (track )
161161
162162 """ Step 3. association with motion"""
163-
164163 u_tracks0 = [strack_pool [i ] for i in u_tracks0_idx if strack_pool [i ].state == TrackState .Tracked ]
165164 u_dets0 = [detections [i ] for i in u_dets0_idx ]
166165
@@ -279,4 +278,3 @@ def remove_duplicate_stracks(stracksa, stracksb):
279278 resa = [t for i ,t in enumerate (stracksa ) if not i in dupa ]
280279 resb = [t for i ,t in enumerate (stracksb ) if not i in dupb ]
281280 return resa , resb
282-
0 commit comments