API到thspersondoesnotex.com网站
thispersondoesnotexist的Python项目详细描述
这个人不知道怎么回事
要安装:
pip install thispersondoesnotexist
{a1}“非官方网站。在
这个人是什么人?在
返回一个不存在的人的JPEG图片的页面,因为它是用人工智能生成的。 打开网页时,直接返回图像,刷新页面将返回一个新图像(尽管由于存储库有限且图像不是实时生成的,所以可以重复这些图像)。在
关于它的一些文章:
- This Person Does Not Exist - Computer generated people Refresh to get a new one | Product Hunt
- Thispersondoesnotexist.com is face-generating AI at its creepiest
为什么要创建/使用“API”?在
为什么不呢?发挥你的想象力!在
要求
- Python 3.6
- 请求库
- 空闲时间
使用
让一个人使用函数
fromthispersondoesnotexistimportget_online_personpicture=awaitget_online_person()# bytes representation of the image# Save to a filefromthispersondoesnotexistimportsave_pictureawaitsave_picture(picture,"a_beautiful_person.jpeg")# If no filename is provided, one will be generated using the checksum of the pictureawaitsave_picture(picture)
让一个人使用class
^{pr2}$生成校验和
如果你想创造一个虚构人物的刮刀,这是很有用的。您将调用这些方法来获取随机图片,为了避免重复,您可以使用它们的校验和—或者直接用自动生成的文件名保存。在
fromthispersondoesnotexistimportget_online_person,get_checksum_from_picture,Person# Using objectperson=Person(fetch_online=True)checksum=person.get_checksum("md5")# Using functionpicture=awaitget_online_person()checksum2=get_checksum_from_picture(picture)# Method is optional, defaults to "md5"
- 项目
标签: