vis/classify_live.py
def draw_label(img, label):
    """
    Draw a text showing which label has been detected.
    :param img: image to be drawn on
    :param label: ILabelValue
    :return: 
    """
    width, height = geom.get_img_dims(img)

    font_scale = 0.003 * height
    position = (int(0.04 * width), int(0.12 * height))
    font = cv2.FONT_HERSHEY_SIMPLEX
    thickness_inline = int(3 * font_scale)
    line_type = cv2.LINE_AA

    color_outline = (0, 0, 0)
    thickness_outline = int(2.5 * 3 * font_scale)

    if label is ll.ILabelValue.IN:
        text = "INSIDE"
        color_inline = (0, 255, 0)
    else:
        text = "OUTSIDE"
        color_inline = (255, 255, 255)

    cv2.putText(img, text, position, font, font_scale, color_outline, thickness_outline, line_type)
    cv2.putText(img, text, position, font, font_scale, color_inline, thickness_inline, line_type)

    Draw a text showing which label has been detected.
    :param img: image to be drawn on
    :param label: ILabelValue
    :return: 
    
Draw a text showing which label has been detected.
Draw a text showing which label has been detected .
def draw_label(img, label):
    width, height = geom.get_img_dims(img)
    font_scale = 0.003 * height
    position = (int(0.04 * width), int(0.12 * height))
    font = cv2.FONT_HERSHEY_SIMPLEX
    thickness_inline = int(3 * font_scale)
    line_type = cv2.LINE_AA
    color_outline = (0, 0, 0)
    thickness_outline = int(2.5 * 3 * font_scale)
    if label is ll.ILabelValue.IN:
        text = "INSIDE"
        color_inline = (0, 255, 0)
    else:
        text = "OUTSIDE"
        color_inline = (255, 255, 255)
    cv2.putText(img, text, position, font, font_scale, color_outline, thickness_outline, line_type)
    cv2.putText(img, text, position, font, font_scale, color_inline, thickness_inline, line_type)
def draw_label ( img , label ) : width , height = geom . get_img_dims ( img ) font_scale = 0.003 * height position = ( int ( 0.04 * width ) , int ( 0.12 * height ) ) font = cv2 . FONT_HERSHEY_SIMPLEX thickness_inline = int ( 3 * font_scale ) line_type = cv2 . LINE_AA color_outline = ( 0 , 0 , 0 ) thickness_outline = int ( 2.5 * 3 * font_scale ) if label is ll . ILabelValue . IN : text = "INSIDE" color_inline = ( 0 , 255 , 0 ) else : text = "OUTSIDE" color_inline = ( 255 , 255 , 255 ) cv2 . putText ( img , text , position , font , font_scale , color_outline , thickness_outline , line_type ) cv2 . putText ( img , text , position , font , font_scale , color_inline , thickness_inline , line_type )
Draw a text showing which label has been detected.
Draw a text showing which label has been detected .
"""
    Draw a text showing which label has been detected.
    :param img: image to be drawn on
    :param label: ILabelValue
    :return: 
    """
None
img
image to be drawn on
image to be drawn on
label
None