-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathioutrack.pyi
More file actions
124 lines (112 loc) · 3.86 KB
/
Copy pathioutrack.pyi
File metadata and controls
124 lines (112 loc) · 3.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
import numpy as np
import numpy.typing as npt
class SORTTracker:
max_age: int
min_hits: int
iou_threshold: float
init_tracker_min_score: float
tracklets: list[KalmanBoxTracker]
n_steps: int
def __new__(
self,
max_age: int = 1,
min_hits: int = 3,
iou_threshold: float = 0.3,
init_tracker_min_score: float = 0.0,
) -> SORTTracker:
"""Create a new SORT bbox tracker
Parameters
----------
max_age
maximum frames a tracklet is kept alive without matching detections
min_hits
minimum number of successive detections before a tracklet is set to alive
iou_threshold
minimum IOU to assign detection to tracklet
init_tracker_min_score
minimum score to create a new tracklet from unmatched detection box
"""
...
def update(
self, boxes: npt.NDArray[np.float32 | np.float64], return_all: bool
) -> npt.NDArray[np.float32]:
"""Update the tracker with new boxes and return position of current tracklets
Parameters
----------
boxes
array of boxes of shape (n_boxes, 5)
of the form [[xmin1, ymin1, xmax1, ymax1, score1], [xmin2,...],...]
return_all
if true return all living trackers, including inactive (but not dead) ones
otherwise return only active trackers (those that got at least min_hits
matching boxes in a row)
Returns
-------
array of tracklet boxes with shape (n_tracks, 5)
of the form [[xmin1, ymin1, xmax1, ymax1, track_id1], [xmin2,...],...]
"""
...
class ByteTrack:
max_age: int
min_hits: int
iou_threshold: float
init_tracker_min_score: float
tracklets: list[KalmanBoxTracker]
n_steps: int
def __new__(
self,
max_age: int = 1,
min_hits: int = 3,
iou_threshold: float = 0.3,
init_tracker_min_score: float = 0.8,
high_score_threshold: float = 0.7,
low_score_threshold: float = 0.1,
) -> SORTTracker:
"""Create a new SORT bbox tracker
Parameters
----------
max_age
maximum frames a tracklet is kept alive without matching detections
min_hits
minimum number of successive detections before a tracklet is set to alive
iou_threshold
minimum IOU to assign detection to tracklet
init_tracker_min_score
minimum score to create a new tracklet from unmatched detection box
high_score_threshold
boxes with higher scores than this will be used in the first round of association
low_score_threshold
boxes with score between low_score_threshold and high_score_threshold
will be used in the second round of association
"""
...
def update(
self, boxes: npt.NDArray[np.float32 | np.float64], return_all: bool
) -> npt.NDArray[np.float32]:
"""Update the tracker with new boxes and return position of current tracklets
Parameters
----------
boxes
array of boxes of shape (n_boxes, 5)
of the form [[xmin1, ymin1, xmax1, ymax1, score1], [xmin2,...],...]
return_all
if true return all living trackers, including inactive (but not dead) ones
otherwise return only active trackers (those that got at least min_hits
matching boxes in a row)
Returns
-------
array of tracklet boxes with shape (n_tracks, 5)
of the form [[xmin1, ymin1, xmax1, ymax1, track_id1], [xmin2,...],...]
"""
...
class Bbox:
xmin: float
ymin: float
xmax: float
ymax: float
class KalmanBoxTracker:
id: int
age: int
hits: int
hit_streak: int
steps_since_hit: int