frying.py 文件源码

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

项目:DeepFryBot 作者: asdvek 项目源码 文件源码
def fry(img):
    coords = find_chars(img)
    img = add_b_emojis(img, coords)
    img = add_laughing_emojis(img, 5)
    eyecoords = find_eyes(img)
    img = add_flares(img, eyecoords)

    # bulge at random coordinates
    [w, h] = [img.width - 1, img.height - 1]
    w *= np.random.random(1)
    h *= np.random.random(1)
    r = int(((img.width + img.height) / 10) * (np.random.random(1)[0] + 1))
    img = bulge(img, np.array([int(w), int(h)]), r, 3, 5, 1.8)

    # some finishing touches
    # print("Adding some finishing touches... ", end='')
    stdout.flush()
    img = add_noise(img, 0.2)
    img = change_contrast(img, 200)
    # print("Done")

    return img


# Downloads image from url to RAM, fries it and saves to disk
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号