API到thspersondoesnotex.com网站

thispersondoesnotexist的Python项目详细描述


这个人不知道怎么回事

要安装:

pip install thispersondoesnotexist

{a1}“非官方网站。在

这个人是什么人?在

返回一个不存在的人的JPEG图片的页面,因为它是用人工智能生成的。 打开网页时,直接返回图像,刷新页面将返回一个新图像(尽管由于存储库有限且图像不是实时生成的,所以可以重复这些图像)。在

关于它的一些文章:

为什么要创建/使用“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"

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
主类中的java访问方法   Javalog4j不读取它的log4j。属性文件   雅加达ee通过Java(web应用程序)使用iText/任何其他使用现成数据的库生成PDF报告   lua使用java阅读TeamSpeak 3消息   将日期转换为BST java   java Spring引用ProxyFactoryBean中带有ref的protoyype bean   如何使java只打印一条带有if语句的消息   java如何通过JavaMail从雅虎服务器发送电子邮件?   使用百分比和BigDecimal的java测试   java如何对字符串数组排序   java验证器+MVC+REST::更新问题   java如何阻止eclipse如此频繁地挂起?   java从AsyncTask(片段内)访问TextView   IDEJava:制作可调整大小和拖动的组件