import base64
from box_utils import cxywh2ltrb, cxywh2xywh
def style():
""" Style string for card models
"""
return """
"""
def card(img_url, img_w, img_h, boxes):
""" This is a hack to streamlit
Solution thanks to: https://discuss.streamlit.io/t/display-svg/172/5
Converting SVG to Base64 and display with tag.
Also we used the
"""
_boxes = ""
for _id, cx, cy, w, h, label, logit, is_selected, _ in boxes:
x, y, w, h = cxywh2xywh(cx, cy, w, h)
x = round(img_w * x)
y = round(img_h * y)
w = round(img_w * w)
h = round(img_h * h)
logit = "%.3f" % logit
_boxes += f'''