Update string formatting to use f-string on components (#125987)

* Update string formatting to use f-string on components

* Update code given review feedback

* Use f-string

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
Alberto Montes
2024-09-19 11:38:25 +02:00
committed by GitHub
parent b471a6e519
commit b2401bf2e3
35 changed files with 81 additions and 99 deletions

View File

@ -324,7 +324,7 @@ class TensorFlowImageProcessor(ImageProcessingEntity):
# Draw detected objects
for instance in values:
label = "{} {:.1f}%".format(category, instance["score"])
label = f"{category} {instance['score']:.1f}%"
draw_box(
draw, instance["box"], img_width, img_height, label, (255, 255, 0)
)