Skip to content

Instantly share code, notes, and snippets.

@rigwild
Created June 12, 2021 12:29
Show Gist options
  • Save rigwild/7255725ad2ea370f2d36de7a93fcf181 to your computer and use it in GitHub Desktop.
Save rigwild/7255725ad2ea370f2d36de7a93fcf181 to your computer and use it in GitHub Desktop.
Download tons of AI generated human faces using https://github.com/google/zx
#!/usr/bin/env zx
const download = async () => {
await $`wget -nv -O - https://thispersondoesnotexist.com/image > file.jpg`
const sha1 = (await $`sha1sum file.jpg`).toString().split(' ')[0]
const exists = (await $`ls`.pipe(nothrow($`grep ${sha1}.jpg`))).toString().trim() !== ''
if (!exists) {
$`mv file.jpg ${sha1}.jpg`
return true
}
console.log('Already downloaded this one!')
$`rm file.jpg`
return false
}
while (true) {
const res = await download()
console.log()
if (res) await sleep(300)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment