ml4a is a Python library for making art with machine learning. It features:
- an API wrapping popular deep learning models with creative applications, including StyleGAN2, SPADE, Neural Style Transfer, DeepDream, and many others.
- a collection of Jupyter notebooks explaining the basics of deep learning for beginners, and providing recipes for using the materials creatively.
ml4a bundles the source code of various open source repositories as git submodules and contains wrappers to streamline and simplify them. For example, to generate sample images with StyleGAN2:
from ml4a import image
from ml4a.models import stylegan2
network_pkl = stylegan2.get_pretrained_model('ffhq')
stylegan2.load_model(network_pkl)
samples, _ = stylegan2.random_sample(3, labels=None, truncation=1.0)
image.display(samples)
Every model in ml4a.models
, including the stylegan2
module above, imports all of the original repository's code into its namespace, allowing low-level access.
You can support ml4a by donating through GitHub sponsors.
Start by joining the Slack or following us on Twitter. Contribute to the codebase, or help write tutorials.
ml4a itself is licensed MIT, but you are also bound to the licenses of any models you use.