Skip to content

Commit

Permalink
Set the scores for TrackedObject Drawables
Browse files Browse the repository at this point in the history
  • Loading branch information
aguscas committed Apr 10, 2024
1 parent ff5b81f commit c9d567f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions norfair/drawing/drawer.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,16 +340,13 @@ def __init__(
self.label = obj.label
self.scores = obj.scores
# TODO: alive points for detections could be the ones over the threshold
# but that info is not available here
self.live_points = np.ones(obj.points.shape[0]).astype(bool)

elif isinstance(obj, TrackedObject):
self.points = obj.estimate
self.id = obj.id
self.label = obj.label
# TODO: TrackedObject.scores could be an interesting thing to have
# it could be the scores of the last detection or some kind of moving average
self.scores = None
self.scores = obj.scores
self.live_points = obj.live_points
elif obj is None:
self.points = points
Expand Down
2 changes: 1 addition & 1 deletion norfair/tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ def tracker_step(self):
self.age += 1
# Advances the tracker's state
self.filter.predict()
self.scores = np.array([np.nan] * self.num_points)
self.scores = None

@property
def hit_counter_is_positive(self):
Expand Down

0 comments on commit c9d567f

Please sign in to comment.