ensure we always have a color

This commit is contained in:
Josh Hawkins 2025-03-30 06:48:48 -05:00
parent 3ce1b2693d
commit f96b301fe9
2 changed files with 7 additions and 3 deletions

View File

@ -88,7 +88,9 @@ class CameraState:
thickness = 1 thickness = 1
else: else:
thickness = 2 thickness = 2
color = self.config.model.colormap[obj["label"]] color = self.config.model.colormap.get(
obj["label"], (255, 255, 255)
)
else: else:
thickness = 1 thickness = 1
color = (255, 0, 0) color = (255, 0, 0)
@ -110,7 +112,9 @@ class CameraState:
and obj["frame_time"] == frame_time and obj["frame_time"] == frame_time
): ):
thickness = 5 thickness = 5
color = self.config.model.colormap[obj["label"]] color = self.config.model.colormap.get(
obj["label"], (255, 255, 255)
)
# debug autotracking zooming - show the zoom factor box # debug autotracking zooming - show the zoom factor box
if ( if (

View File

@ -442,7 +442,7 @@ class TrackedObject:
if bounding_box: if bounding_box:
thickness = 2 thickness = 2
color = self.colormap[self.obj_data["label"]] color = self.colormap.get(self.obj_data["label"], (255, 255, 255))
# draw the bounding boxes on the frame # draw the bounding boxes on the frame
box = self.thumbnail_data["box"] box = self.thumbnail_data["box"]