The project is updating...
You can get the pretraied weight in here
Welcome to TorchGAN, a versatile and user-friendly framework designed to simplify the creation, customization, and deployment of Generative Adversarial Networks (GANs). Whether you're a machine learning researcher, data scientist, or creative coder, TorchGAN empowers you with pre-trained weights, modular tools, and an intuitive API to craft state-of-the-art GAN models tailored to your vision.
Generative Adversarial Networks are transforming domains like image synthesis, style transfer, and data augmentation. However, their complexity often poses challenges in training, customization, and deployment. TorchGAN bridges this gap by providing:
-
Pre-trained Weights: Kickstart your projects with high-quality weights for popular GAN architectures including
CycleGAN,Pix2pix,DCGAN,cGAN,StyleGAN, ... -
Modular Design: Easily combine datasets, architectures, and training strategies to suit your needs.
-
Simplified Workflow: Streamlined APIs for rapid prototyping and deployment.
-
Extensibility: Add custom loss functions, datasets, or models with minimal effort.
-
Community Focus: Share weights, collaborate on models, and contribute to a growing ecosystem.
-
Rich Model Library: Access pre-trained models like DCGAN, CycleGAN, StyleGAN3, and BigGAN.
-
Flexible Pipelines: Customize data preprocessing, model architectures, and training loops effortlessly.
-
Cross-Platform Compatibility: Run on CPUs, GPUs, or TPUs, locally or in the cloud.
-
Visualization Suite: Monitor training with real-time plots and sample generation.
-
Dual Interfaces: Use the Python API for advanced control or the CLI for quick experiments.
-
Comprehensive Docs: Extensive tutorials and examples to get you up and running.
- Python 3.8+
- PyTorch 1.10+ (with CUDA for GPU support)
- Dependencies: NumPy, Matplotlib, torchvision
-
Clone the repository:
git clone https://github.com/yourusername/torchgan.git cd torchgan -
Install dependencies:
pip install -r requirements.txt
-
Quick Example
-
Train a CycleGAN to convert winter to summer:
from torchgan.models import CycleGAN from torchgan.engine import Engine # Initialize model # You can set path to your pretrained weigth or use 'default' for our weight model = CycleGAN(weight='path/to/your/weights') # Inference generated_image = model.generate( image_path='path/to/your/image', save_path='path/to/save' ) # If you want to train on your dataset # Load dataset dataset = load_dataset( dataset_path='path/to/your/dataset' ) # Train Engine.train( model=model, type='cyclegan', train_dataset=train_dataset, epochs=10, lr=0.0001, step_size=30, save_path='path/to/save/weight' ) # Evaluation Engine.eval( model=model, type='cyclegan', val_dataset=val_dataset, metric='psnr' # psnr | fid | is )
Explore the examples/ folder for more tutorials, including DCGAN, StyleGAN3, and conditional GANs.
- Winter to Summer
- Summer to Winter
CycleGAN: Project | Paper | Torch | Tensorflow Core Tutorial
Pix2pix: Project | Paper | Torch | Tensorflow Core Tutorial
Other Model: Updating...
TorchGAN is licensed under the MIT License. Use, modify, and share it freely!
This project aims to make GAN models more accessible to the community, not for commercial purposes, but to foster innovation and collaboration in the field of generative AI. Join us in building a vibrant ecosystem for GAN enthusiasts!
Ready to ignite your GAN projects? Clone TorchGAN, dive into the examples, and start creating with ease! 🔥







