Created
February 19, 2021 06:01
-
-
Save makeev/31248bd2c7a6d54d9b256205e50c9f76 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
from thispersondoesnotexist import get_online_person | |
from thispersondoesnotexist import save_picture | |
async def f(): | |
picture = await get_online_person() # bytes representation of the image | |
# Save to a file | |
await save_picture(picture, "a_beautiful_person.jpeg") | |
# If no filename is provided, one will be generated using the checksum of the picture | |
# await save_picture(picture) | |
loop = asyncio.get_event_loop() | |
loop.run_until_complete(f()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment