Please check LSUN webpage for more information about the dataset.

Data Release

All the images in one category are stored in one lmdb database file. The value of each entry is the jpg binary data. We resize all the images so that the smaller dimension is 256 and compress the images in jpeg with quality 75.

Citing LSUN

If you find LSUN dataset useful in your research, please consider citing:

    Author = {Yu, Fisher and Zhang, Yinda and Song, Shuran and Seff, Ari and Xiao, Jianxiong},
    Title = {LSUN: Construction of a Large-scale Image Dataset using Deep Learning with Humans in the Loop},
    Journal = {arXiv preprint arXiv:1506.03365},
    Year = {2015}

Download data

Please make sure you have cURL installed

# Download the whole latest data setpython3 # Download the whole latest data set to <data_dir>python3 -o <data_dir># Download data for bedroompython3 -c bedroom # Download testing setpython3 -c test

Demo code


Install Python

Install Python dependency: numpy, lmdb, opencv


View the lmdb content

python3 view <image db path>

Export the images to a folder

python3 export <image db path> --out_dir <output directory>


Export all the images in valuation sets in the current folder to a "data" subfolder.

python3 export *_val_lmdb --out_dir data


We expect one category prediction for each image in the testing set. The name of each image is the key value in the LMDB database. Each category has an index as listed in index list. The submitted results on the testing set will be stored in a text file with one line per image. In each line, there are two fields separated by a whitespace. The first is the image key and the second is the predicted category index. For example:

0001c44e5f5175a7e6358d207660f971d90abaf4 0
000319b73404935eec40ac49d1865ce197b3a553 1
00038e8b13a97577ada8a884702d607220ce6d15 2
00039ba1bf659c30e50b757280efd5eba6fc2fe1 3

The score for the submission is the percentage of correctly predicted labels. In our evaluation, we will double check our ground truth labels for the testing images and we may remove some images with controversial labels in the final evaluation.

GitHub - fyu/lsun at
LSUN Dataset Documentation and Demo Code. Contribute to fyu/lsun development by creating an account on GitHub.