discopat.tracking
SORT: A Simple, Online and Realtime Tracker.
Copyright (C) 2016-2020 Alex Bewley alex@bewley.ai
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Functions
|
Assign detections to tracked object (both represented as bounding boxes). |
|
Takes a bounding box in the form [x1,y1,x2,y2] and returns z in the form |
|
Takes a bounding box in the centre form [x,y,s,r] and returns it in the form |
|
From SORT: Computes IOU between two bboxes in the form [x1,y1,x2,y2]. |
|
|
Parse input arguments. |
Classes
|
This class represents the internal state of individual tracked objects observed as bbox. |
|
- class discopat.tracking.KalmanBoxTracker(bbox)[source]
Bases:
objectThis class represents the internal state of individual tracked objects observed as bbox.
- count = 0
- class discopat.tracking.Sort(max_age=1, min_hits=3, iou_threshold=0.3)[source]
Bases:
object- update(dets=array([], shape=(0, 5), dtype=float64))[source]
- Params:
dets - a numpy array of detections in the format [[x1,y1,x2,y2,score],[x1,y1,x2,y2,score],…]
Requires: this method must be called once for each frame even with empty detections (use np.empty((0, 5)) for frames without detections). Returns the a similar array, where the last column is the object ID.
NOTE: The number of objects returned may differ from the number of detections provided.
- discopat.tracking.associate_detections_to_trackers(detections, trackers, iou_threshold=0.3)[source]
Assign detections to tracked object (both represented as bounding boxes).
Returns 3 lists of matches, unmatched_detections and unmatched_trackers
- discopat.tracking.convert_bbox_to_z(bbox)[source]
- Takes a bounding box in the form [x1,y1,x2,y2] and returns z in the form
[x,y,s,r] where x,y is the centre of the box and s is the scale/area and r is the aspect ratio
- discopat.tracking.convert_x_to_bbox(x, score=None)[source]
- Takes a bounding box in the centre form [x,y,s,r] and returns it in the form
[x1,y1,x2,y2] where x1,y1 is the top left and x2,y2 is the bottom right