-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathsort_maha.py
More file actions
23 lines (19 loc) · 806 Bytes
/
Copy pathsort_maha.py
File metadata and controls
23 lines (19 loc) · 806 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from similari import Sort, BoundingBox, SpatioTemporalConstraints, PositionalMetricType
if __name__ == '__main__':
constraints = SpatioTemporalConstraints()
constraints.add_constraints([(1, 1.0)])
sort = Sort(shards = 4, bbox_history = 10,
max_idle_epochs = 5,
method=PositionalMetricType.maha(),
spatio_temporal_constraints=constraints)
box = BoundingBox(10., 5., 7., 7.).as_xyaah()
tracks = sort.predict([(box, 1111)])
for t in tracks:
print(t)
# you have to call wasted from time to time to purge wasted tracks
# out of the waste bin. Without doing that the memory utilization will grow.
sort.skip_epochs(10)
wasted = sort.wasted()
print(wasted[0])
# or just clear wasted
sort.clear_wasted()