爱意满满的作品展示区。
flingjie

使用 python 将 one piece 的歌词生成路飞和乔巴

  •  4
     
  •   flingjie ·
    flingjie · Jan 11, 2016 · 6465 views
    This topic created in 3948 days ago, the information mentioned may be changed or developed.

    使用 jieba 和 wordcloud 将海贼王的歌词生成主角的样子. 放图
    路飞:
    路飞
    乔巴:
    乔巴

    https://github.com/flingjie/words_image
    纯属娱乐,欢迎吐槽

    Supplement 1  ·  Jan 14, 2016

    增加生成 gif 的功能

    one piece

    31 replies  •  2016-01-13 09:51:29 +08:00
    that5
    that5
    Jan 11, 2016
    1
    好玩!
    fengxiang
    fengxiang
    Jan 11, 2016 via Android❤️1
    2
    要是 v2 这种帖子能多点该多好,而不是首页上完厕所擦不擦弟弟。
    fengxiang
    fengxiang
    Jan 11, 2016 via Android
    3
    这个颜色是怎么算的啊?蛮好看的
    ethego
    ethego
    Jan 11, 2016
    4
    requirements 重新生成一下,少了 PIL 吧
    adeweb
    adeweb
    Jan 11, 2016
    5
    @fengxiang 噗~ 不能赞同更多。
    adeweb
    adeweb
    Jan 11, 2016
    6
    已 star ,很喜欢。
    bk201
    bk201
    Jan 11, 2016
    7
    完全看不清原歌词了
    flingjie
    flingjie
    OP
    Jan 11, 2016
    8
    @fengxiang 颜色是用 wordcloud 中 ImageColorGenerator 自动从原图获取的
    @ethego 已更新 requirements
    kenis
    kenis
    Jan 11, 2016
    9
    @fengxiang 颜色应该是图片本身采样出的颜色

    楼主的项目很好玩,赞
    that5
    that5
    Jan 11, 2016
    10
    @flingjie 我不懂程序,能否根据微博发言生成图片?估计更好玩
    alexkh
    alexkh
    Jan 11, 2016
    11
    有个文件命名错误: requirments.txt ,少了个 e ,应该是 requirements.txt
    flingjie
    flingjie
    OP
    Jan 11, 2016
    12
    @that5 可以根据微博生成, 回头试试
    @alexkh 多谢指正
    Strikeactor
    Strikeactor
    Jan 11, 2016
    13
    感觉特别大的都是比较符合主题的关键词,这个是靠什么判断的,出现频率?
    alexkh
    alexkh
    Jan 11, 2016
    14
    试了下,经常提示 RuntimeError: Invalid DISPLAY variable 是什么原因?

    在 Google 上查了下,添加了 matplotlib.use('Agg') 也无济于事。

    @flingjie 没出现这种情况吗?
    flingjie
    flingjie
    OP
    Jan 11, 2016
    15
    @Strikeactor 是的, 频率越高字体越大
    @alexkh 没遇到, 你是什么环境
    kn007
    kn007
    Jan 11, 2016
    16
    超赞诶
    alexkh
    alexkh
    Jan 11, 2016
    17
    @flingjie 连的 VPS , Ubutu 14.04
    klakekent
    klakekent
    Jan 11, 2016
    18
    @fengxiang 是啊 V2EX 的水贴越来越多了 毫无营养
    flingjie
    flingjie
    OP
    Jan 11, 2016
    19
    @alexkh matplotlib.use('Agg') 需要写在 import pyplot 之前,
    ```
    import matplotlib
    matplotlib.use('Agg')
    import matplotlib.pyplot as plt
    ```
    是按这个顺序写的吗?
    alexkh
    alexkh
    Jan 11, 2016
    20
    @flingjie 我试试,先谢了~
    yurivvvvv
    yurivvvvv
    Jan 11, 2016
    21
    mark
    WeberXie
    WeberXie
    Jan 11, 2016
    22
    可以借我当头像吗
    112xiangtao
    112xiangtao
    Jan 11, 2016
    23
    兄弟厉害啊
    flingjie
    flingjie
    OP
    Jan 11, 2016
    24
    @WeberXie 随意用,不客气
    @112xiangtao ^_^
    lcqtdwj
    lcqtdwj
    Jan 11, 2016
    25
    不错 蛮有意思,给个提议,最好能任一张图片和各自生成一个词云图。
    lcqtdwj
    lcqtdwj
    Jan 11, 2016
    26
    @lcqtdwj 打错,是图片和歌词
    cxl008
    cxl008
    Jan 11, 2016
    27
    不错
    flingjie
    flingjie
    OP
    Jan 12, 2016
    28
    @lcqtdwj 有这个打算,现在加上了
    zhe13
    zhe13
    Jan 12, 2016
    29
    哥,这么巧,我就在想着怎么做这玩意。我正在看一个叫做[words-filling]( https://github.com/zhe13/Words_Filling)的仓库,他的字是旋转的,能给我讲讲之间的区别吗?
    cppgeek
    cppgeek
    Jan 13, 2016
    30
    可以边放这首歌,边用歌词填充图像吗?
    flingjie
    flingjie
    OP
    Jan 13, 2016
    31
    @cppgeek 哈哈,这个要求有点高, 下一步打算生成 gif 动图
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   5385 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 130ms · UTC 02:08 · PVG 10:08 · LAX 18:08 · JFK 21:08
    ♥ Do have faith in what you're doing.