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

Stylized-ImageNet ships a recipe, not the dataset

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

529 stars66 forksPythonMIT

At a glance

What is it?
The repository behind the ICLR 2019 work on shape bias gives you the pipeline, the Docker image and the paths to configure, and asks for 134 GB of disk and a GPU in exchange. It also pins a 2018 torchvision against a modern torch, which is the first thing you will have to change.
Who is it for?
Use Stylized-ImageNet if you want the shape-bias intervention rather than the dataset, and be honest about what you are signing up for: roughly 38 GB of paintings, 134 GB of output, a GPU, and a dependency file that cannot install as written. The research pipeline is well documented and the alternatives are named honestly, including a 16-class proxy that you can download today.
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 83 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 October 11, 2026, and from our analysis. They are not legal advice.

Editorial analysis

There is no download link, so producing the dataset is the workflow

The project is explicit that it will not hand you a link. Three routes are offered instead: stylize the dataset yourself using this code, find someone at your own institution who has already done it, or fall back on the 16-class version called stylized, which comes from the model-vs-human toolbox and can be obtained through that toolbox or from its v0.1 release.

The repository layout matches that position. The top level holds a LICENSE, a README, requirements.txt, a code directory and an example_imgs directory. There is no data directory, no archive, and no manifest of checksums. What you have is a recipe, and the README's own framing is that the point is to show how the stylization is done so that a CNN can be nudged towards learning shapes rather than local textures.

The disk budget is 134 GB out, 38 GB in, and three directories to clean up

Step one is to download train.zip from the painter-by-numbers dataset on Kaggle and extract the paintings into code/paintings_raw/, which the README sizes at about 38 GB. Step two is to point the code at your own copy of ImageNet and say where the output should go. The finished Stylized-ImageNet is stated to need 134 GB of disk, described as a little less than standard ImageNet at 181 GB.

Step four is cleanup: once the run finishes, paintings_raw/, paintings_excluded/ and paintings_preprocessed/ are no longer needed and can be deleted. That is a meaningful second-order saving, and it tells you the pipeline materialises three intermediate painting sets along the way. Anyone budgeting storage should assume the peak is the sum of the inputs and the output, not the output alone.

requirements.txt pairs a 2018 torchvision with a torch from the 2.x line

The dependency file has five lines and one of them does not add up. It pins torchvision to 0.2.2 and torch to 2.12.0, plus numpy 1.22.0, Pillow 12.2.0 and tensorboardX 1.8. torchvision 0.2.2 is a release from the torch 1.0 generation, published years before torch 2.x existed. The two pins describe different eras of the same library, and torchvision is tightly coupled to torch, so this is the first thing to reconcile before anything else.

The file also uses exact equality rather than ranges for every entry, which is defensible for a research artefact whose numbers have to be reproducible. It just means there is no fallback. If you install it as written you get one specific combination, and that combination is not internally consistent.

The tested Docker image is a CUDA 9 generation tag

Step three tells you to change into the code directory and run create_stylized_imagenet.sh, assuming GPU access, and says the easiest way to avoid installing the libraries yourself is the Docker image the project provides at bethgelab/deeplearning on Docker Hub. The repository is stated to be tested with the tag bethgelab/deeplearning:cuda9.0-cudnn7.

That tag is from the CUDA 9 and cuDNN 7 generation, which is the same era as the torchvision pin. So the environment story is internally consistent with itself and inconsistent with the requirements file: the tested image predates torch 2.x, and the requirements file asks for torch 2.x while pinning a torchvision from before it. You will end up picking one of the two rather than satisfying both.

Two paths are edited into code/general.py, and the shell script takes no arguments

Configuration is not done through flags or a config file. You set the IMAGENET_PATH variable in code/general.py to wherever your ImageNet copy lives, and you set STYLIZED_IMAGENET_PATH to wherever the finished dataset should be written. There is one prerequisite on the input side that catches people out: the ImageNet images have to be split into two subdirectories, train/ and val/, before the pipeline will see them.

The script itself is invoked by name with no documented parameters. That is a reasonable choice for a one-off dataset build where there is exactly one correct answer, and it is also why the two variables matter so much: there is no other place to change the behaviour, so editing the Python file is the entire configuration surface.

The AdaIN implementation is vendored wholesale from another repository

The credit section is unusually direct. The code relies heavily on the pytorch-AdaIN repository by Naoto Inoue, which is a PyTorch implementation of the AdaIN style transfer approach by X. Huang and S. Belongie, published at ICCV 2017 as Arbitrary Style Transfer in Real-time with Adaptive Instance Normalization. The README states that the entire AdaIN implementation is taken from that repository.

The stated reason for consolidating is effort: so that anyone can create Stylized-ImageNet with as little additional effort as possible, preprocessing and style transfer together live in one place. That is a good reason, and it also means the maintenance question and the upstream question are the same question. An alternative is named for anyone who wants to stylize a different dataset: bethgelab/stylize-datasets, which the README describes as providing similar but more general functionality.

A 2021 update redirects you to a toolbox that has since absorbed the use case

The first line of the README is an update from August 2021 pointing at bethgelab/model-vs-human, a toolbox that supports stylized data, includes human comparison data, and evaluates arbitrary PyTorch or TensorFlow models to produce a PDF report on out-of-distribution generalisation behaviour with ready-to-use figures. The framing is that if you want to know how your model copes with challenging stylized images, this is where that work now happens.

There is a similar split around the paper's artefacts. Pre-trained CNNs trained on Stylized-ImageNet are hosted in the separate rgeirhos:texture-vs-shape repository, and the README says that all code, data and materials concerning the paper are available there. Stylized-ImageNet is the dataset-building recipe; texture-vs-shape is where the results live.

Editorial conclusion

Use Stylized-ImageNet if you want the shape-bias intervention rather than the dataset, and be honest about what you are signing up for: roughly 38 GB of paintings, 134 GB of output, a GPU, and a dependency file that cannot install as written. The research pipeline is well documented and the alternatives are named honestly, including a 16-class proxy that you can download today. What has not aged well is the environment. Budget a day for reconciling the torch and torchvision pins before you budget anything for stylization, and decide early whether you need the full 1000-class set or whether the 16-class version answers your question.

Frequently asked questions

Can I download Stylized-ImageNet directly?

No download link is offered. You can stylize it yourself with the code here, find someone at your institution who has already produced it, or use the 16-class version called stylized from bethgelab:model-vs-human, available through that toolbox or from its v0.1 release.

How much disk space does creating Stylized-ImageNet take?

About 134 GB for the finished dataset, against 181 GB for standard ImageNet, plus roughly 38 GB of paintings extracted into code/paintings_raw/. Three intermediate painting directories can be deleted once the run completes.

Will the pinned requirements install together as written?

They are inconsistent as written. torchvision is pinned to 0.2.2 while torch is pinned to 2.12.0, and torchvision 0.2.2 belongs to the torch 1.0 generation. Every entry uses exact equality, so there is no fallback resolution.

Which Docker image is Stylized-ImageNet tested with?

The bethgelab/deeplearning image on Docker Hub, specifically the tag bethgelab/deeplearning:cuda9.0-cudnn7. It is offered as the way to avoid installing the libraries by hand.

Where are the CNNs pre-trained on Stylized-ImageNet?

In the separate rgeirhos:texture-vs-shape repository, which is also where the README says all code, data and materials concerning the paper are available.

Can Stylized-ImageNet replace ImageNet during training without changing normalization?

That is the stated intent. The project describes it as a drop-in replacement and says its results use identical normalization, with ImageNet mean and standard deviation applied to both datasets, taken from the PyTorch ImageNet example training script.

Official sources

  1. Issues
  2. License: MIT
  3. Project website
  4. README
  5. rgeirhos/Stylized-ImageNet on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/rgeirhos-stylized-imagenet.svg)](https://hysenlabs.com/projects/rgeirhos-stylized-imagenet)