mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 09:47:13 +00:00
catch key error when saving image (#18365)
This commit is contained in:
parent
5b9a9d8e04
commit
9cb6464c58
@ -246,7 +246,8 @@ class TensorFlowImageProcessor(ImageProcessingEntity):
|
||||
|
||||
for category, values in matches.items():
|
||||
# Draw custom category regions/areas
|
||||
if self._category_areas[category] != [0, 0, 1, 1]:
|
||||
if (category in self._category_areas
|
||||
and self._category_areas[category] != [0, 0, 1, 1]):
|
||||
label = "{} Detection Area".format(category.capitalize())
|
||||
draw_box(draw, self._category_areas[category], img_width,
|
||||
img_height, label, (0, 255, 0))
|
||||
|
Loading…
x
Reference in New Issue
Block a user