|
Safemotion Lib
|
Public Member Functions | |
| __init__ (self, obj_score_thrs=dict(high=0.6, low=0.1), init_track_thr=0.7, weight_iou_with_det_scores=True, match_iou_thrs=dict(high=0.1, low=0.5, tentative=0.3), num_tentatives=3, **kwargs) | |
| confirmed_ids (self) | |
| unconfirmed_ids (self) | |
| init_track (self, id, obj) | |
| update_track (self, id, obj) | |
| pop_invalid_tracks (self, frame_id) | |
| assign_ids (self, ids, det_bboxes, det_labels, weight_iou_with_det_scores=False, match_iou_thr=0.5) | |
| track (self, motion, bboxes, labels, frame_id) | |
Public Member Functions inherited from base_tracker.BaseTracker | |
| reset (self) | |
| empty (self) | |
| ids (self) | |
| with_reid (self) | |
| update (self, **kwargs) | |
Public Attributes | |
| obj_score_thrs | |
| init_track_thr | |
| weight_iou_with_det_scores | |
| match_iou_thrs | |
| num_tentatives | |
| kf | |
| confirmed_ids | |
| unconfirmed_ids | |
| num_tracks | |
Public Attributes inherited from base_tracker.BaseTracker | |
| momentums | |
| num_frames_retain | |
| fp16_enabled | |
| num_tracks | |
| tracks | |
| memo_items | |
Tracker for ByteTrack.
Args:
obj_score_thrs (dict): Detection score threshold for matching objects.
- high (float): Threshold of the first matching. Defaults to 0.6.
- low (float): Threshold of the second matching. Defaults to 0.1.
init_track_thr (float): Detection score threshold for initializing a
new tracklet. Defaults to 0.7.
weight_iou_with_det_scores (bool): Whether using detection scores to
weight IOU which is used for matching. Defaults to True.
match_iou_thrs (dict): IOU distance threshold for matching between two
frames.
- high (float): Threshold of the first matching. Defaults to 0.1.
- low (float): Threshold of the second matching. Defaults to 0.5.
- tentative (float): Threshold of the matching for tentative
tracklets. Defaults to 0.3.
num_tentatives (int, optional): Number of continuous frames to confirm
a track. Defaults to 3.
init_cfg (dict or list[dict], optional): Initialization config dict.
Defaults to None.
Definition at line 9 of file byte_tracker.py.
| byte_tracker.ByteTracker.__init__ | ( | self, | |
| obj_score_thrs = dict(high=0.6, low=0.1), | |||
| init_track_thr = 0.7, | |||
| weight_iou_with_det_scores = True, | |||
| match_iou_thrs = dict(high=0.1, low=0.5, tentative=0.3), | |||
| num_tentatives = 3, | |||
| ** | kwargs ) |
Reimplemented from base_tracker.BaseTracker.
Definition at line 31 of file byte_tracker.py.
| byte_tracker.ByteTracker.assign_ids | ( | self, | |
| ids, | |||
| det_bboxes, | |||
| det_labels, | |||
| weight_iou_with_det_scores = False, | |||
| match_iou_thr = 0.5 ) |
Assign ids.
Args:
ids (list[int]): Tracking ids.
det_bboxes (Tensor): of shape (N, 5)
weight_iou_with_det_scores (bool, optional): Whether using
detection scores to weight IOU which is used for matching.
Defaults to False.
match_iou_thr (float, optional): Matching threshold.
Defaults to 0.5.
Returns:
tuple(int): The assigning ids.
Definition at line 102 of file byte_tracker.py.
| byte_tracker.ByteTracker.confirmed_ids | ( | self | ) |
Confirmed ids in the tracker.
Definition at line 50 of file byte_tracker.py.
| byte_tracker.ByteTracker.init_track | ( | self, | |
| id, | |||
| obj ) |
Initialize a track.
Reimplemented from base_tracker.BaseTracker.
Definition at line 61 of file byte_tracker.py.
| byte_tracker.ByteTracker.pop_invalid_tracks | ( | self, | |
| frame_id ) |
Pop out invalid tracks.
Reimplemented from base_tracker.BaseTracker.
Definition at line 89 of file byte_tracker.py.
| byte_tracker.ByteTracker.track | ( | self, | |
| motion, | |||
| bboxes, | |||
| labels, | |||
| frame_id ) |
Tracking forward function.
Args:
img (Tensor): of shape (N, C, H, W) encoding input images.
Typically these should be mean centered and std scaled.
img_metas (list[dict]): list of image info dict where each dict
has: 'img_shape', 'scale_factor', 'flip', and may also contain
'filename', 'ori_shape', 'pad_shape', and 'img_norm_cfg'.
model (nn.Module): MOT model.
bboxes (Tensor): of shape (N, 5).
labels (Tensor): of shape (N, ).
frame_id (int): The id of current frame, 0-index.
rescale (bool, optional): If True, the bounding boxes should be
rescaled to fit the original scale of the image. Defaults to
False.
Returns:
tuple: Tracking results.
Reimplemented from base_tracker.BaseTracker.
Definition at line 154 of file byte_tracker.py.
| byte_tracker.ByteTracker.unconfirmed_ids | ( | self | ) |
Unconfirmed ids in the tracker.
Definition at line 56 of file byte_tracker.py.
| byte_tracker.ByteTracker.update_track | ( | self, | |
| id, | |||
| obj ) |
Update a track.
Reimplemented from base_tracker.BaseTracker.
Definition at line 73 of file byte_tracker.py.
| byte_tracker.ByteTracker.confirmed_ids |
Definition at line 220 of file byte_tracker.py.
| byte_tracker.ByteTracker.init_track_thr |
Definition at line 40 of file byte_tracker.py.
| byte_tracker.ByteTracker.kf |
Definition at line 178 of file byte_tracker.py.
| byte_tracker.ByteTracker.match_iou_thrs |
Definition at line 43 of file byte_tracker.py.
| byte_tracker.ByteTracker.num_tentatives |
Definition at line 45 of file byte_tracker.py.
| byte_tracker.ByteTracker.num_tracks |
Definition at line 285 of file byte_tracker.py.
| byte_tracker.ByteTracker.obj_score_thrs |
Definition at line 39 of file byte_tracker.py.
| byte_tracker.ByteTracker.unconfirmed_ids |
Definition at line 242 of file byte_tracker.py.
| byte_tracker.ByteTracker.weight_iou_with_det_scores |
Definition at line 42 of file byte_tracker.py.