From c9d567f14b073f2bf53d8d714820707092e88d66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Castro?= Date: Wed, 10 Apr 2024 13:58:27 -0300 Subject: [PATCH] Set the scores for TrackedObject Drawables --- norfair/drawing/drawer.py | 5 +---- norfair/tracker.py | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/norfair/drawing/drawer.py b/norfair/drawing/drawer.py index 83657143..b60ab0e4 100644 --- a/norfair/drawing/drawer.py +++ b/norfair/drawing/drawer.py @@ -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 diff --git a/norfair/tracker.py b/norfair/tracker.py index 1b6a44a7..b9bbd233 100644 --- a/norfair/tracker.py +++ b/norfair/tracker.py @@ -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):