Pix2Pix pretrained generators (PyTorch)
The original Pix2Pix (Isola et al., CVPR 2017, Image-to-Image Translation with Conditional
Adversarial Networks) pretrained U-Net generators, hosted for
mediasynthesismuseum/pix2pix.
These are the official berkeley PyTorch weights (junyanz/pytorch-CycleGAN-and-pix2pix).
| File | Task | Input |
|---|---|---|
edges2shoes.pth |
edges โ shoe photo | draw an outline |
edges2handbags.pth |
edges โ handbag photo | draw an outline |
facades_label2photo.pth |
label map โ building facade | draw colored regions |
day2night.pth |
daytime โ nighttime photo | upload a photo |
map2sat.pth |
map tile โ satellite image | upload a map |
All are unet_256 generators: input_nc=output_nc=3, ngf=64, BatchNorm.
Preprocessing / usage
Resize to 256ร256, normalize to [-1, 1] ((x/127.5) - 1), RGB; de-normalize the output the
same way. The UnetGenerator definition is included in this repo (pix2pix_net.py).
import torch
from huggingface_hub import hf_hub_download
from pix2pix_net import build_generator
G = build_generator()
sd = torch.load(hf_hub_download("mediasynthesismuseum/pix2pix", "edges2shoes.pth"),
map_location="cpu", weights_only=False)
G.load_state_dict(sd); G.eval()
Credit: Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, Alexei A. Efros (pix2pix), and the pytorch-CycleGAN-and-pix2pix authors.