twilio_app.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:who_the_hill 作者: newsdev 项目源码 文件源码
def draw_bounding_boxes(celeb_objs, file):
    '''
    Draws bounding boxes around all faces in inputted file determined by celeb_objs
    '''
    colors = []
    im = Image.open(file)
    draw = ImageDraw.Draw(im)
    for i in range(len(celeb_objs)):
        color = rectangle_colors[i % len(rectangle_colors)]
        colors.append(color)
        coords = get_coords_from_ratios(celeb_objs[i].to_dict()['BoundingBox'], im.width, im.height)
        draw_width_rectangle(draw, coords, color, rectangle_width)

    del draw
    file.seek(0)
    im.save(file, 'PNG')
    return colors
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号