def draw_text(img, text, position=(<NUM_LIT:10>, <NUM_LIT:10>), font='<STR_LIT>', font_size=<NUM_LIT>, color=(<NUM_LIT:0>, <NUM_LIT:0>, <NUM_LIT:0>)):
_check_pil()<EOL>font_files = _find_font_file(font)<EOL>if len(font_files) == <NUM_LIT:0>:<EOL><INDENT>logger.warn("<STR_LIT>".format(font))<EOL>font = ImageFont.load_default()<EOL><DEDENT>else:<EOL><INDENT>font = ImageFont.truetype(font_files[<NUM_LIT:0>], font_size)<EOL><DEDENT>img = Image.fromarray(img)<EOL>draw = ImageDraw.Draw(img)<EOL>draw.text(position, text, fill=color, font=font)<EOL>return np.asarray(img)<EOL>
Draws text over the image. Requires PIL.

    Args:
        img: The image to use.
        text: The text string to overlay.
        position: The text (x, y) position. (Default value = (10, 10))
        font: The ttf or open type font to use. (Default value = 'FreeSans.ttf')
        font_size: The text font size. (Default value = 12)
        color: The (r, g, b) values for text color. (Default value = (0, 0, 0))

    Returns: Image overlayed with text.