Skip to content
Snippets Groups Projects
Commit 284ca224 authored by User expired's avatar User expired :spy_tone1:
Browse files

better visualization for detected labels

parent 04370263
No related branches found
No related tags found
No related merge requests found
......@@ -210,7 +210,9 @@ def visualize_patches(keypoints, patches, text, img_rgb):
# replace the patch of the zoomed sign so that the patch that is fed to t flow can be directly seen
img_rgb[y[0]:y[1], x[0]:x[1]] = patch
cv2.rectangle(img_rgb, (x[0], y[0]), (x[1], y[1]), (255, 255, 255), thickness=1)
cv2.putText(img_rgb, text[i], (x[0], y[0] - 5), cv2.FONT_HERSHEY_SIMPLEX, 0.5, (255, 255, 255), thickness=1)
# draw a text within a rectangle of uniform color
cv2.rectangle(img_rgb, (x[0] - 10, y[0] - 25), (x[0] + TENSOR_RES[0] + 10, y[0]), (255, 255, 255), -1)
cv2.putText(img_rgb, text[i], (x[0] - 10, y[0] - 5), cv2.FONT_HERSHEY_SIMPLEX, 0.55, (0, 0, 0), thickness=2)
return img_rgb
......
......@@ -154,7 +154,7 @@ def detect_sign(img_rgb_stream, image_timestamp):
# publish results
publish_results(center, r, d, label, precision, image_timestamp)
text.append("c: {} p: {:1.3f} d:{:1.3f}".format(sign_classifier.labelOfClass(label), precision, d))
text.append("c: {} p: {}% d: {:1.3f}".format(sign_classifier.labelOfClass(label), int(precision * 100), d))
if visualize:
if len(text) > 0:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment