Account for one extra letter in size_em.
Fixes black background bars beeing too small in current demos.
Change-Id: I8301933373726a22bf255fce3d0a049c9dbaab81
diff --git a/edgetpuvision/classify.py b/edgetpuvision/classify.py
index 9f12af5..408ecda 100644
--- a/edgetpuvision/classify.py
+++ b/edgetpuvision/classify.py
@@ -37,7 +37,7 @@
stroke_width='0.5em')}))
def size_em(length):
- return '%sem' % str(0.6 * length)
+ return '%sem' % str(0.6 * (length + 1))
def overlay(title, results, inference_time, inference_rate, layout):
x0, y0, width, height = layout.window
diff --git a/edgetpuvision/detect.py b/edgetpuvision/detect.py
index c02199a..8908617 100644
--- a/edgetpuvision/detect.py
+++ b/edgetpuvision/detect.py
@@ -54,7 +54,7 @@
Object.__str__ = lambda self: 'Object(id=%d, label=%s, score=%.2f, %s)' % self
def size_em(length):
- return '%sem' % str(0.6 * length)
+ return '%sem' % str(0.6 * (length + 1))
def color(i, total):
return tuple(int(255.0 * c) for c in colorsys.hsv_to_rgb(i / total, 1.0, 1.0))