rename vars

This commit is contained in:
Josh Hawkins 2024-12-20 18:21:30 -06:00
parent c708e3b656
commit ff1193ecbf
2 changed files with 8 additions and 4 deletions

View File

@ -164,8 +164,8 @@ class CameraState:
text, text,
f"{obj['score']:.0%} {int(obj['area'])}" f"{obj['score']:.0%} {int(obj['area'])}"
+ ( + (
f" {float(obj['estimated_speed']):.1f}" f" {float(obj['current_estimated_speed']):.1f}"
if obj["estimated_speed"] != 0 if obj["current_estimated_speed"] != 0
else "" else ""
), ),
thickness=thickness, thickness=thickness,

View File

@ -138,7 +138,7 @@ class TrackedObject:
"region": obj_data["region"], "region": obj_data["region"],
"score": obj_data["score"], "score": obj_data["score"],
"attributes": obj_data["attributes"], "attributes": obj_data["attributes"],
"estimated_speed": self.estimated_speed, "current_estimated_speed": self.current_estimated_speed,
} }
thumb_update = True thumb_update = True
@ -387,7 +387,11 @@ class TrackedObject:
box[3], box[3],
self.obj_data["label"], self.obj_data["label"],
f"{int(self.thumbnail_data['score']*100)}% {int(self.thumbnail_data['area'])}" f"{int(self.thumbnail_data['score']*100)}% {int(self.thumbnail_data['area'])}"
+ (f" {self.estimated_speed:.1f}" if self.estimated_speed != 0 else ""), + (
f" {self.thumbnail_data['current_estimated_speed']:.1f}"
if self.thumbnail_data["current_estimated_speed"] != 0
else ""
),
thickness=thickness, thickness=thickness,
color=color, color=color,
) )