Open liruiluo opened 11 months ago
The ID of each object is initialized by SAM and maintained by DeAOT. The code is only used to obtain the ID of new objects and is not related to the ID of objects in different frames.
I just find this problem. The initialized obj_num should be self.curr_idx + 1 not self.curr_idx
Check find_new_objs code, it seems that you think sam's ID for the same object in different frames is the same, but in fact it is different. Is this a code problem? def find_new_objs(self, track_mask, seg_mask): ''' Compare tracked results from AOT with segmented results from SAM. Select objects from background if they are not tracked. Arguments: track_mask: numpy array (h,w) seg_mask: numpy array (h,w) Return: new_obj_mask: numpy array (h,w) ''' new_obj_mask = (track_mask==0) * seg_mask new_obj_ids = np.unique(new_obj_mask) new_obj_ids = new_obj_ids[new_obj_ids!=0]
obj_num = self.get_obj_num() + 1