sdxl-latents-ffhq / README.md
Birchlabs's picture
Update README.md
667d992
|
raw
history blame
4.58 kB

https://github.com/NVlabs/ffhq-dataset samples encoded to float16 SDXL latents via Ollin VAE.

Dataset created using this script.

VAE encoder used NATTEN attention, kernel size 17.

Didn't bother saving mean & logvar, because variance is low enough it's not worth the doubling of filesize to retain.
Sampled from diagonal gaussian distribution, saved the resulting latents.
Also kept the original image.

Schema/usage:

from typing import TypedDict, Iterator
from webdataset import WebDataset
Sample = TypedDict('Sample', {
  '__key__': str,
  '__url__': str,
  'img.png': bytes, # PIL image, serialized. 1024*1024px
  'latent.pth': bytes, # FloatTensor, serialized. 128*128 latents
})

it: Iterator[Sample] = WebDataset('{00000..00035}.tar')

for sample in it:
  pass
# avg/val.pt (mean):
[-2.8982300758361816, -0.9609659910202026, 0.2416578084230423, -0.307400107383728]
# avg/sq.pt:
[65.80902099609375, 32.772762298583984, 36.080204010009766, 25.072017669677734]

# std
# (sq - val**2)**.5
[7.5768914222717285, 5.643518924713135, 6.001816749572754, 4.997751712799072]
# 1/std
[0.13198024034500122, 0.17719440162181854, 0.16661621630191803, 0.2000899761915207]

Flickr-Faces-HQ Dataset (FFHQ)

Flickr-Faces-HQ (FFHQ) is a high-quality image dataset of human faces, originally created as a benchmark for generative adversarial networks (GAN):

A Style-Based Generator Architecture for Generative Adversarial Networks
Tero Karras (NVIDIA), Samuli Laine (NVIDIA), Timo Aila (NVIDIA)
https://arxiv.org/abs/1812.04948

The dataset consists of 70,000 high-quality PNG images at 1024×1024 resolution and contains considerable variation in terms of age, ethnicity and image background. It also has good coverage of accessories such as eyeglasses, sunglasses, hats, etc. The images were crawled from Flickr, thus inheriting all the biases of that website, and automatically aligned and cropped using dlib. Only images under permissive licenses were collected. Various automatic filters were used to prune the set, and finally Amazon Mechanical Turk was used to remove the occasional statues, paintings, or photos of photos.

Please note that this dataset is not intended for, and should not be used for, development or improvement of facial recognition technologies. For business inquiries, please visit our website and submit the form: NVIDIA Research Licensing

Licenses

The individual images were published in Flickr by their respective authors under either Creative Commons BY 2.0, Creative Commons BY-NC 2.0, Public Domain Mark 1.0, Public Domain CC0 1.0, or U.S. Government Works license. All of these licenses allow free use, redistribution, and adaptation for non-commercial purposes. However, some of them require giving appropriate credit to the original author, as well as indicating any changes that were made to the images. The license and original author of each image are indicated in the metadata.

The dataset itself (including JSON metadata, download script, and documentation) is made available under Creative Commons BY-NC-SA 4.0 license by NVIDIA Corporation. You can use, redistribute, and adapt it for non-commercial purposes, as long as you (a) give appropriate credit by citing our paper, (b) indicate any changes that you've made, and (c) distribute any derivative works under the same license.