catch key error when saving image (#18365)
This commit is contained in:
parent
5b9a9d8e04
commit
9cb6464c58
1 changed files with 2 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue