Skip to main content

TorchStyle is a Pytorch based framework for GAN based Neural Style Transfer.

Project description

TorchStyle is a Pytorch based framework for designing and developing GAN based Neural Style Transfer. This framework has been designed to provide building blocks for popular GANs and also to allow customization for cutting edge research.

System requirements

TorchStyle should work on

  • all Linux distributions no earlier than Ubuntu 16.04
  • macOS X
  • Windows 10


Using pip (for stable release):

pip install torchstyle

Using pip (for latest master):

conda install -c tczhangzhi torchstyle

From source:

git clone
cd torchstyle
python install

Getting Started

The network architectures of popular GANs and cutting edge GAN based Neural Style Transfer methods are out of the box:

from torchstyle.model.acgan import Generator, Discriminator

g_model = Generator()
d_model = Discriminator()

The diverse loss functions and complicated adversarial training methods are packed in different learners. It is convenient for users to reproduce the state-of-the-art training methods quickly without knowing implementation details:

from torchstyle.trainer.acgan import ACGANTrainer

trainer = ACGANTrainer(g_model, d_model, dataloader, device=device)


Setup environments:

export PYTHONPATH=./

Run the test case:

python tests/


Coming soon.


PyTorch is MIT-style licensed, as found in the LICENSE file.

Copyright (c) 2020-present, Zhang Zhi

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

torchstyle-0.0.1.tar.gz (2.9 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page