Datasets:

Modalities:
Text
Formats:
text
Size:
< 1K
Libraries:
Datasets
isLandLZ commited on
Commit
dda1b0e
1 Parent(s): b8b6624

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +158 -0
README.md ADDED
@@ -0,0 +1,158 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## Flickr-Faces-HQ Dataset (FFHQ)
2
+ ![Python 3.6](https://img.shields.io/badge/python-3.6-green.svg?style=plastic)
3
+ ![License CC](https://img.shields.io/badge/license-CC-green.svg?style=plastic)
4
+ ![Format PNG](https://img.shields.io/badge/format-PNG-green.svg?style=plastic)
5
+ ![Resolution 1024&times;1024](https://img.shields.io/badge/resolution-1024&times;1024-green.svg?style=plastic)
6
+ ![Images 70000](https://img.shields.io/badge/images-70,000-green.svg?style=plastic)
7
+
8
+ ![Teaser image](./ffhq-teaser.png)
9
+
10
+ Flickr-Faces-HQ (FFHQ) is a high-quality image dataset of human faces, originally created as a benchmark for generative adversarial networks (GAN):
11
+
12
+ > **A Style-Based Generator Architecture for Generative Adversarial Networks**<br>
13
+ > Tero Karras (NVIDIA), Samuli Laine (NVIDIA), Timo Aila (NVIDIA)<br>
14
+ > http://stylegan.xyz/paper
15
+
16
+ The dataset consists of 70,000 high-quality PNG images at 1024&times;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](https://www.flickr.com/), thus inheriting all the biases of that website, and automatically aligned and cropped using [dlib](http://dlib.net/). Only images under permissive licenses were collected. Various automatic filters were used to prune the set, and finally [Amazon Mechanical Turk](https://www.mturk.com/) was used to remove the occasional statues, paintings, or photos of photos.
17
+
18
+ For business inquiries, please contact [[email protected]](mailto:[email protected])
19
+
20
+ For press and other inquiries, please contact Hector Marinez at [[email protected]](mailto:[email protected])
21
+
22
+ ## Licenses
23
+
24
+ The individual images were published in Flickr by their respective authors under either [Creative Commons BY 2.0](https://creativecommons.org/licenses/by/2.0/), [Creative Commons BY-NC 2.0](https://creativecommons.org/licenses/by-nc/2.0/), [Public Domain Mark 1.0](https://creativecommons.org/publicdomain/mark/1.0/), [Public Domain CC0 1.0](https://creativecommons.org/publicdomain/zero/1.0/), or [U.S. Government Works](http://www.usa.gov/copyright.shtml) 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.
25
+
26
+ * [https://creativecommons.org/licenses/by/2.0/](https://creativecommons.org/licenses/by/2.0/)
27
+ * [https://creativecommons.org/licenses/by-nc/2.0/](https://creativecommons.org/licenses/by-nc/2.0/)
28
+ * [https://creativecommons.org/publicdomain/mark/1.0/](https://creativecommons.org/publicdomain/mark/1.0/)
29
+ * [https://creativecommons.org/publicdomain/zero/1.0/](https://creativecommons.org/publicdomain/zero/1.0/)
30
+ * [http://www.usa.gov/copyright.shtml](http://www.usa.gov/copyright.shtml)
31
+
32
+ The dataset itself (including JSON metadata, download script, and documentation) is made available under [Creative Commons BY-NC-SA 4.0](https://creativecommons.org/licenses/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**.
33
+
34
+ * [https://creativecommons.org/licenses/by-nc-sa/4.0/](https://creativecommons.org/licenses/by-nc-sa/4.0/)
35
+
36
+ ## Overview
37
+
38
+ All data is hosted on Google Drive:
39
+
40
+ | Path | Size | Files | Format | Description
41
+ | :--- | :--: | ----: | :----: | :----------
42
+ | [ffhq-dataset](https://drive.google.com/open?id=1u2xu7bSrWxrbUxk-dT-UvEJq8IjdmNTP) | 2.56 TB | 210,014 | | Main folder
43
+ | &boxvr;&nbsp; [ffhq-dataset-v1.json](https://drive.google.com/open?id=1IB0BFbN_eRZx9UkJqLHSgJiQhqX-PrI6) | 254 MB | 1 | JSON | Metadata including copyright info, URLs, etc.
44
+ | &boxvr;&nbsp; [images1024x1024](https://drive.google.com/open?id=1u3Hbfn3Q6jsTlte3BY85CGwId77H-OOu) | 89.1 GB | 70,000 | PNG | Aligned and cropped images at 1024&times;1024
45
+ | &boxvr;&nbsp; [thumbnails128x128](https://drive.google.com/open?id=1uJkWCpLUM-BnXW3H_IgVMdfENeNDFNmC) | 1.95 GB | 70,000 | PNG | Thumbnails at 128&times;128
46
+ | &boxvr;&nbsp; [in-the-wild-images](https://drive.google.com/open?id=1YyuocbwILsHAjTusSUG-_zL343jlVBhf) | 955 GB | 70,000 | PNG | Original images from Flickr
47
+ | &boxvr;&nbsp; [tfrecords](https://drive.google.com/open?id=1LTBpJ0W_WLjqza3zdayligS8Dh1V1gA6) | 273 GB | 9 | tfrecords | Multi-resolution data for [StyleGAN](http://stylegan.xyz/code) and [ProGAN](https://github.com/tkarras/progressive_growing_of_gans)
48
+ | &boxur;&nbsp; [zips](https://drive.google.com/open?id=1WocxvZ4GEZ1DI8dOz30aSj2zT6pkATYS) | 1.28 TB | 4 | ZIP | Contents of each folder as a ZIP archive.
49
+
50
+ High-level statistics:
51
+
52
+ ![Pie charts](./ffhq-piecharts.png)
53
+
54
+ For use cases that require separate training and validation sets, we have appointed the first 60,000 images to be used for training and the remaining 10,000 for validation. In the [StyleGAN paper](http://stylegan.xyz/paper), however, we used all 70,000 images for training.
55
+
56
+ We have explicitly made sure that there are no duplicate images in the dataset itself. However, please note that the `in-the-wild` folder may contain multiple copies of the same image in cases where we extracted several different faces from the same image.
57
+
58
+ ## Download script
59
+
60
+ You can either grab the data directly from Google Drive or use the provided [download script](./download_ffhq.py). The script makes things considerably easier by automatically downloading all the requested files, verifying their checksums, retrying each file several times on error, and employing multiple concurrent connections to maximize bandwidth.
61
+
62
+ ```
63
+ > python download_ffhq.py -h
64
+ usage: download_ffhq.py [-h] [-j] [-s] [-i] [-t] [-w] [-r] [-a]
65
+ [--num_threads NUM] [--status_delay SEC]
66
+ [--timing_window LEN] [--chunk_size KB]
67
+ [--num_attempts NUM]
68
+
69
+ Download Flickr-Face-HQ (FFHQ) dataset to current working directory.
70
+
71
+ optional arguments:
72
+ -h, --help show this help message and exit
73
+ -j, --json download metadata as JSON (254 MB)
74
+ -s, --stats print statistics about the dataset
75
+ -i, --images download 1024x1024 images as PNG (89.1 GB)
76
+ -t, --thumbs download 128x128 thumbnails as PNG (1.95 GB)
77
+ -w, --wilds download in-the-wild images as PNG (955 GB)
78
+ -r, --tfrecords download multi-resolution TFRecords (273 GB)
79
+ -a, --align recreate 1024x1024 images from in-the-wild images
80
+ --num_threads NUM number of concurrent download threads (default: 32)
81
+ --status_delay SEC time between download status prints (default: 0.2)
82
+ --timing_window LEN samples for estimating download eta (default: 50)
83
+ --chunk_size KB chunk size for each download thread (default: 128)
84
+ --num_attempts NUM number of download attempts per file (default: 10)
85
+ ```
86
+
87
+ ```
88
+ > python ..\download_ffhq.py --json --images
89
+ Downloading JSON metadata...
90
+ \ 100.00% done 1/1 files 0.25/0.25 GB 43.21 MB/s ETA: done
91
+ Parsing JSON metadata...
92
+ Downloading 70000 files...
93
+ | 100.00% done 70000/70000 files 89.19 GB/89.19 GB 59.87 MB/s ETA: done
94
+ ```
95
+
96
+ The script also serves as a reference implementation of the automated scheme that we used to align and crop the images. Once you have downloaded the in-the-wild images with `python download_ffhq.py --wilds`, you can run `python download_ffhq.py --align` to reproduce exact replicas of the aligned 1024&times;1024 images using the facial landmark locations included in the metadata.
97
+
98
+ ## Metadata
99
+
100
+ The `ffhq-dataset-v1.json` file contains the following information for each image in a machine-readable format:
101
+
102
+ ```
103
+ {
104
+ "0": { # Image index
105
+ "category": "training", # Training or validation
106
+ "metadata": { # Info about the original Flickr photo:
107
+ "photo_url": "https://www.flickr.com/photos/...", # - Flickr URL
108
+ "photo_title": "DSCF0899.JPG", # - File name
109
+ "author": "Jeremy Frumkin", # - Author
110
+ "country": "", # - Country where the photo was taken
111
+ "license": "Attribution-NonCommercial License", # - License name
112
+ "license_url": "https://creativecommons.org/...", # - License detail URL
113
+ "date_uploaded": "2007-08-16", # - Date when the photo was uploaded to Flickr
114
+ "date_crawled": "2018-10-10" # - Date when the photo was crawled from Flickr
115
+ },
116
+ "image": { # Info about the aligned 1024x1024 image:
117
+ "file_url": "https://drive.google.com/...", # - Google Drive URL
118
+ "file_path": "images1024x1024/00000.png", # - Google Drive path
119
+ "file_size": 1488194, # - Size of the PNG file in bytes
120
+ "file_md5": "ddeaeea6ce59569643715759d537fd1b", # - MD5 checksum of the PNG file
121
+ "pixel_size": [1024, 1024], # - Image dimensions
122
+ "pixel_md5": "47238b44dfb87644460cbdcc4607e289", # - MD5 checksum of the raw pixel data
123
+ "face_landmarks": [...] # - 68 face landmarks reported by dlib
124
+ },
125
+ "thumbnail": { # Info about the 128x128 thumbnail:
126
+ "file_url": "https://drive.google.com/...", # - Google Drive URL
127
+ "file_path": "thumbnails128x128/00000.png", # - Google Drive path
128
+ "file_size": 29050, # - Size of the PNG file in bytes
129
+ "file_md5": "bd3e40b2ba20f76b55dc282907b89cd1", # - MD5 checksum of the PNG file
130
+ "pixel_size": [128, 128], # - Image dimensions
131
+ "pixel_md5": "38d7e93eb9a796d0e65f8c64de8ba161" # - MD5 checksum of the raw pixel data
132
+ },
133
+ "in_the_wild": { # Info about the in-the-wild image:
134
+ "file_url": "https://drive.google.com/...", # - Google Drive URL
135
+ "file_path": "in-the-wild-images/00000.png", # - Google Drive path
136
+ "file_size": 3991569, # - Size of the PNG file in bytes
137
+ "file_md5": "1dc0287e73e485efb0516a80ce9d42b4", # - MD5 checksum of the PNG file
138
+ "pixel_size": [2016, 1512], # - Image dimensions
139
+ "pixel_md5": "86b3470c42e33235d76b979161fb2327", # - MD5 checksum of the raw pixel data
140
+ "face_rect": [667, 410, 1438, 1181], # - Axis-aligned rectangle of the face region
141
+ "face_landmarks": [...], # - 68 face landmarks reported by dlib
142
+ "face_quad": [...] # - Aligned quad of the face region
143
+ }
144
+ },
145
+ ...
146
+ }
147
+ ```
148
+
149
+ ## Acknowledgements
150
+
151
+ We thank Jaakko Lehtinen, David Luebke, and Tuomas Kynk&auml;&auml;nniemi for in-depth discussions and helpful comments; Janne Hellsten, Tero Kuosmanen, and Pekka J&auml;nis for compute infrastructure and help with the code release.
152
+
153
+ We also thank Vahid Kazemi and Josephine Sullivan for their work on automatic face detection and alignment that enabled us to collect the data in the first place:
154
+
155
+ > **One Millisecond Face Alignment with an Ensemble of Regression Trees**<br>
156
+ > Vahid Kazemi, Josephine Sullivan<br>
157
+ > Proc. CVPR 2014<br>
158
+ > https://www.cv-foundation.org/openaccess/content_cvpr_2014/papers/Kazemi_One_Millisecond_Face_2014_CVPR_paper.pdf