You probably remember the website thispersondoesnotexist.com, since it was posted on every content aggregator on the planet like two days ago.

TFW No ThisPersonDoesNotExist API

Downloading Bulk Images/Faces with Python and urllib2

import urllib2 import time from PIL import Image from PIL import ImageFile ImageFile.LOAD_TRUNCATED_IMAGES = True import os import csv import base64 # The directory to put the downloaded files into d = "./images/" # Create the directory, if it doesn't already exist if not os.path.exists(d): os.makedirs(d) # The url that images are shown at u = "https://thispersondoesnotexist.com/image" # The user agent. Replace this with something descriptive to your use case, probably. ua = "Some bot: https://www.256kilobytes.com/content/show/4903/" # The HTTP_REFERER metadata in the request header. Optionally replace with your own URL. r = "https://www.256kilobytes.com/content/show/4903/" for x in range(0,99): print "" print "// ===== ===== File " + str(x) + " ===== ===== //" print "Downloading content from url: " + u; req = urllib2.Request(u) req.add_header('Referer' , r) req.add_header('User-Agent', ua) resp = urllib2.urlopen(req) content = resp.read() fn = d + 'fucking-image-' + str(x).zfill(5) + '.jpeg' print "Writing to " + fn + "..." f = open(fn, "a") f.write(content) # Scale the image and make a copy of it as a thumbnail file, ext = os.path.splitext(fn) im = Image.open(fn) #im.thumbnail([128, 128]) im.thumbnail([256, 256]) thumb = file + ".thumbnail.jpeg" print "Resizing the file to " + thumb + "..." im.save(thumb, "JPEG") # Base64 Encode the Image's Thumbnail (Optional, to Put Into CSV) print "Base64 encoding the thumbnail..." with open(thumb, "rb") as image_file: b64 = "data:image/jpeg;base64," + base64.b64encode(image_file.read()) # Put the image details into a cocksucking CSV print "Putting the file details into a cocksucking CSV..." csv_fn = "output-summary.csv" row = [x, fn, thumb, b64] with open(csv_fn, 'a') as csvFile: writer = csv.writer(csvFile) writer.writerow(row) csvFile.close() # Wait five seconds between requests to not DDoS/make excessive requests to the server time.sleep(5) print ""

The Result

And so on and so forth.

ThisPersonDoesNotExist Copyright

It's unclear exactly what the copyright is, but here's what has been stated elsewhere on the Internet:

There's a generated sample set of images on the same site as the paper. I'm assuming the guy who set up the site is serving up those sample images. Here's what the NVIDIA github repo has to say about the datasets: "All material, excluding the Flickr-Faces-HQ dataset, is made available under Creative Commons BY-NC 4.0 license by NVIDIA Corporation. You can use, redistribute, and adapt the material for non-commercial purposes, as long as you give appropriate credit by citing our paper and indicating any changes that you've made." Source: https://tech.slashdot.org/story/19/02/14/199200/this-person-does-not-exist-website-uses-ai-to-create-realistic-yet-horrifying-faces

And some other related documents:

If anyone has a clearer/more definitive answer regarding copyright, feel free to post it in the comments.

Share This Post