fixed_window
sleap_nn.tracking.candidates.fixed_window
¶
Module to generate Fixed window candidates.
Classes:
| Name | Description |
|---|---|
FixedWindowCandidates |
Fixed-window method for candidate generation. |
FixedWindowCandidates
¶
Fixed-window method for candidate generation.
This module handles tracker_queue using the fixed window method, where track assignments
are determined based on the last window_size frames.
Attributes:
| Name | Type | Description |
|---|---|---|
window_size |
Number of previous frames to compare the current predicted instance with. Default: 5. |
|
min_new_track_points |
We won't spawn a new track for an instance with fewer than this many points. Default: 0. |
|
tracker_queue |
Deque object that stores the past |
|
all_tracks |
List of track IDs that are created. |
Methods:
| Name | Description |
|---|---|
__init__ |
Initialize class variables. |
add_new_tracks |
Add new track IDs to the |
available_new_tracks |
How many fresh track IDs can still be minted, or |
get_features_from_track_id |
Return list of |
get_new_track_id |
Return a new track_id. |
get_track_instances |
Return an instance of |
update_tracks |
Assign tracks to |
Source code in sleap_nn/tracking/candidates/fixed_window.py
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 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | |
current_tracks
property
¶
Get track IDs of items currently in tracker queue.
__init__(window_size=5, min_new_track_points=0)
¶
Initialize class variables.
Source code in sleap_nn/tracking/candidates/fixed_window.py
add_new_tracks(current_instances, add_to_queue=True)
¶
Add new track IDs to the TrackInstances object and to the tracker queue.
Source code in sleap_nn/tracking/candidates/fixed_window.py
available_new_tracks()
¶
How many fresh track IDs can still be minted, or None if unbounded.
fixed_window has no track cap, so this is always None. The
counterpart on LocalQueueCandidates reports the remaining headroom
under max_tracks. Read by Tracker.assign_tracks to decide whether an
infeasible pairing may be dropped: a dropped detection only survives if it
can spawn a fresh track, so with no headroom the forced match is kept
instead of letting the detection vanish from the output.
Source code in sleap_nn/tracking/candidates/fixed_window.py
get_features_from_track_id(track_id, candidates_list=None)
¶
Return list of TrackedInstanceFeature objects for instances in tracker queue with the given track_id.
If candidates_list is None, then features of all the instances in the
tracker queue are returned by default. Else, only the features from the given candidates_list are returned.
Source code in sleap_nn/tracking/candidates/fixed_window.py
get_new_track_id()
¶
get_track_instances(feature_list, untracked_instances, frame_idx, image)
¶
Return an instance of TrackInstances object for the untracked_instances.
Source code in sleap_nn/tracking/candidates/fixed_window.py
update_tracks(current_instances, row_inds, col_inds, tracking_scores)
¶
Assign tracks to TrackInstances based on the output of track matching algorithm.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
current_instances
|
TrackInstances
|
|
required |
row_inds
|
array
|
List of indices for the |
required |
col_inds
|
array
|
List of track IDs that have been assigned a new instance. |
required |
tracking_scores
|
List[float]
|
List of tracking scores from the cost matrix. |
required |