words_image.py 文件源码

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

项目:words_image 作者: flingjie 项目源码 文件源码
def generate_image(words, image):
    graph = np.array(image)
    wc = WordCloud(font_path=os.path.join(CUR_DIR, 'fonts/simhei.ttf'),
                   background_color='white', max_words=MAX_WORDS, mask=graph)
    wc.generate_from_frequencies(words)
    image_color = ImageColorGenerator(graph)
    return wc, image_color
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号