Open-source project
rgeirhos/Stylized-ImageNet avatar
rgeirhos/Stylized-ImageNet

Stylized-ImageNet: reproducing a texture-versus-shape training set from AdaIN style transfer

Code to create Stylized-ImageNet, a stylized version of standard ImageNet (ICLR 2019 Oral)

529 stars65 forksPythonMIT

At a glance

What is it?
The repository is a one-shot pipeline for turning a local ImageNet copy into Stylized-ImageNet, the dataset behind the ICLR 2019 texture-bias paper. It is a build script, not a downloadable dataset, and it expects roughly 38 GB of paintings plus 134 GB of output disk before it produces anything useful.
Who is it for?
Adopt this repository if you already hold a licensed ImageNet copy, have a GPU and about 172 GB of free disk, and need the exact Stylized-ImageNet construction used in the ICLR 2019 paper. Do not adopt it if you only want to measure texture bias on an existing model: bethgelab/model-vs-human ships a downloadable 16-class stylized set and evaluation code, which is a far shorter path.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 57 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

The problem is a training set that does not exist as a download

The paper behind this repository argues that ImageNet-trained CNNs key on local texture rather than global object shape, and that training on stylized images shifts that balance. The dataset that demonstrates the claim is not distributed. The README answers the obvious question directly: asked whether the dataset can be shared via a download link, the answer is no, with three alternatives offered (stylize it yourself, find someone at your institution who already did, or use the 16-class stylized set from bethgelab/model-vs-human as a proxy). So the repository exists to make the first option reproducible. Its audience is narrow: researchers who want the full 1000-class corpus, who hold their own ImageNet copy, and who are willing to spend the compute and disk to regenerate it. Anyone who wants a quick out-of-distribution check on a trained model is pointed elsewhere in the README itself.

AdaIN style transfer, applied per ImageNet image

The mechanism is style transfer, not augmentation in the usual sense. The README states that the code heavily relies on naoto0804/pytorch-AdaIN and that the entire AdaIN implementation is taken from that repository, referring to Huang and Belongie's ICCV 2017 method, Arbitrary Style Transfer in Real-time with Adaptive Instance Normalization. The repository bundles preprocessing, style transfer and the rest into one place so that a single script can walk the corpus. The visual result is described in the README's own terms: local textures are heavily distorted while global object shapes remain more or less intact. That property is the whole point. A model trained on this data still sees the same objects in the same positions, but the surface statistics that a texture-biased network would latch onto have been rewritten. Style comes from paintings, not from a fixed set of style images, so each ImageNet image can be stylized in many ways. The pipeline stages the paintings, excludes some, preprocesses others, then writes the stylized corpus, which is why the intermediate directories exist at all.

Getting it running: two paths in general.py, then one shell script

The README gives four steps. First, download train.zip from Kaggle's painter-by-numbers dataset and extract the paintings into code/paintings_raw/, about 38 GB. Second, either point the IMAGENET_PATH variable in code/general.py at an existing ImageNet copy or obtain the images from the ImageNet website; the images must be split into train/ and val/ subdirectories. In the same file, set STYLIZED_IMAGENET_PATH, the output location. The README notes the output needs 134 GB, slightly less than standard ImageNet at 181 GB. Third, from code/, run create_stylized_imagenet.sh, assuming access to a GPU. Fourth, optionally delete paintings_raw/, paintings_excluded/ and paintings_preprocessed/. Two configuration details matter more than they look. The variables live in a Python module rather than a config file or environment variables, so they are edited in place. And the README states the repository is tested with the bethgelab/deeplearning:cuda9.0-cudnn7 Docker image, which is the supported way to avoid assembling the library stack by hand. On normalization, the README is explicit that Stylized-ImageNet is a drop-in replacement for ImageNet: the same mean and std from the PyTorch ImageNet example training script are used for both datasets.

Disk, GPU and a licence you have to bring yourself

The constraints are stated up front and they are the practical story. The paintings are roughly 38 GB before any stylization, the output is 134 GB, and the README recommends deleting the three intermediate directories afterwards, which implies peak usage above the final figure. A GPU is assumed. Nothing here downloads ImageNet for you, and the README's own FAQ makes clear the maintainers will not host the result, so obtaining the source images and their terms is the adopter's problem. The repository's own licence is MIT, which covers this code; it says nothing about the paintings from Kaggle's painter-by-numbers dataset or about ImageNet itself, and those are separate terms you have to check on your own. The README does not give legal guidance and neither does this review. One more gap worth naming: the README never states where the AdaIN model weights come from or whether the Docker image already contains them. Since the AdaIN code is borrowed wholesale from pytorch-AdaIN, the weights presumably travel with that implementation, but the supplied material does not confirm it, so treat that as the first thing to check before a long run.

Where this is the wrong tool

Two failure modes are visible from the README alone. The first is scope: this repository is tailored to ImageNet. If your dataset is something else, the README recommends bethgelab/stylize-datasets instead, described as providing similar functionality but more general. The second is intent. If the goal is evaluation rather than training data generation, the README's own update points to bethgelab/model-vs-human, a toolbox that supports stylized data with human comparison data and evaluates arbitrary PyTorch or TensorFlow models, producing a PDF report. Loading a model and running an evaluation is minutes of work; generating 134 GB of stylized images is not. There is also a maintenance signal in the repository metadata: the project is not archived, but the README's most recent note is dated August 2021 and points outward to other repositories rather than describing new work here. Treat this as a frozen artifact tied to a specific paper and a specific container tag, not a library that tracks current PyTorch releases. The pinned cuda9.0-cudnn7 image is a hint that the dependency stack is old.

stylize-datasets and model-vs-human as the two real alternatives

The README names both, and they differ from this repository in approach rather than degree. bethgelab/stylize-datasets is the general case: same idea of applying style transfer to an image dataset, but not bound to ImageNet's directory layout or class structure, so you can point it at your own corpus. rgeirhos/Stylized-ImageNet is the special case, with the ImageNet-specific preprocessing and the exact settings behind the published results baked in. If you need to reproduce the paper's dataset, the special case is what you want. If you need stylized versions of something else, the general tool is the shorter route and the README says so. bethgelab/model-vs-human is different again: it is an evaluation toolbox, not a generator, and it comes with a downloadable 16-class stylized set. That set is a proxy, not Stylized-ImageNet, so it will not let you train a 1000-class model on stylized data. It will let you ask how texture-biased an existing model is, with human comparison data attached, which is the question most people actually have.

Maintenance cost and what to verify before you commit

There are no retrieved releases, so there is no versioned upgrade path to reason about. The repository is a script plus a container tag, and the README's own escape hatch for trouble is to try bethgelab/stylize-datasets instead, which tells you how much ongoing support to expect. Upgrading means rebuilding against a newer CUDA and PyTorch than the tested cuda9.0-cudnn7 image, and the README gives no guidance on that. The realistic cost is therefore a one-time reproduction run: fetch 38 GB of paintings, point two variables at the right paths, run one shell script on a GPU, then reclaim the intermediates. The MIT licence covers the code in this repository and nothing else; the paintings and the ImageNet images carry their own terms. Before starting, confirm the train/ and val/ split under IMAGENET_PATH, confirm 134 GB of free space at STYLIZED_IMAGENET_PATH, and confirm the AdaIN weights are present in your container, because a run that fails on missing weights wastes the download and the setup time rather than the GPU hours.

Editorial conclusion

Adopt this repository if you already hold a licensed ImageNet copy, have a GPU and about 172 GB of free disk, and need the exact Stylized-ImageNet construction used in the ICLR 2019 paper. Do not adopt it if you only want to measure texture bias on an existing model: bethgelab/model-vs-human ships a downloadable 16-class stylized set and evaluation code, which is a far shorter path. Before committing, verify three things in your own checkout: that IMAGENET_PATH points at a directory containing train/ and val/, that STYLIZED_IMAGENET_PATH sits on a volume with 134 GB free, and that the AdaIN weights the script expects are reachable from the container, since the README does not state where they come from.

Official sources

  1. Issues
  2. License: MIT
  3. Project website
  4. README
  5. rgeirhos/Stylized-ImageNet on GitHub
Community notes

Community notes