pix2pix: Image-to-image translation with conditional GANs
Torch implementation for paired image-to-image translation using cGANs.
Learn more about pix2pix
pix2pix is a generative model implementation based on conditional adversarial networks (cGANs) designed for paired image-to-image translation tasks. It uses a generator-discriminator architecture where the generator learns to map from input images to output images conditioned on the input, while the discriminator distinguishes real output pairs from generated ones. The framework supports bidirectional translation (AtoB or BtoA) and includes training and testing pipelines with support for GPU acceleration via CUDA. Common applications include converting semantic segmentation maps to photorealistic images, generating building facades from architectural drawings, and translating between day and night scene photographs.

Conditional adversarial framework
Uses paired image data with a discriminator that evaluates both input and output together, enabling more structured translations compared to unconditional GANs. This conditioning mechanism allows the model to learn task-specific mappings rather than generating arbitrary outputs.
Modest data requirements
Achieves reasonable results on relatively small datasets, such as 400 images for facade generation trained in approximately 2 hours on a single GPU. This contrasts with many deep learning approaches that typically require substantially larger training sets.
Bidirectional translation support
Supports training in both directions (AtoB and BtoA) through a command-line parameter, allowing the same architecture to learn reverse mappings without separate model implementations. This flexibility enables experimentation with different translation directions on the same dataset.
from models import create_model
from options.test_options import TestOptions
from data import create_dataset
opt = TestOptions().parse()
opt.num_threads = 0
opt.batch_size = 1
opt.direction = 'AtoB'
model = create_model(opt)
model.setup(opt)
dataset = create_dataset(opt)
for i, data in enumerate(dataset):
model.set_input(data)
model.test()
visuals = model.get_current_visuals()
generated_image = visuals['fake_B']Related Repositories
Discover similar tools and frameworks used by developers
fish-speech
Transformer-based TTS with voice cloning from reference audio.
optuna
Define-by-run Python framework for automated hyperparameter tuning.
mmdetection
Modular PyTorch framework for object detection research and deployment.
LightRAG
Graph-based retrieval framework for structured RAG reasoning.
pytorch
Python framework for differentiable tensor computation and deep learning.