← all repositories
david-gpu/srez

Teaching a DCGAN to upscale faces instead of dreaming them from noise

It upscales 16x16 face thumbnails to 64x64 by rewiring a DCGAN to take low-res pixels instead of random noise as input.

srez
Not currently ranked — collecting fresh signals.
star history

What it does

srez trains a neural network to enlarge 16x16 images into 64x64 portraits. It learns from the CelebA face dataset, so the model essentially hallucinates sharp facial details that match the low-resolution input. The output looks plausible for well-lit, frontal faces; anything else and the illusion frays.

The interesting bit

The twist is architectural: the generator is a DCGAN fed the actual 16x16 image rather than the usual gaussian noise vector. To keep the generator honest—so it invents a believable face rather than a believable stranger—an L1 loss term penalizes the downscaled output for straying from the original thumbnail. The authors note this L1 term is what keeps the network from getting stuck early and accelerates convergence.

Key highlights

  • Generator built with ResNet modules; the adversarial/discriminator network is deliberately kept simpler because ResNet did not help on that side.
  • Trains in about three hours on a GTX 1080 (~10 epochs, 130k batches).
  • Includes a demo mode that renders an animation of the network’s learning progress.
  • Expects the CelebA “Align&Cropped” dataset; the model’s world is basically well-illuminated, forward-facing faces.

Caveats

  • Performance drops noticeably on angled faces, poor lighting, or occlusions like eyeglasses and hands.
  • The README is silent on inference speed, memory footprint, and whether the model generalizes beyond CelebA faces.

Verdict

Worth a look if you are studying how GAN architectures can be repurposed for super-resolution or want a concrete, small-scale training experiment. Skip it if you need a general-purpose image upscaler or production-grade face restoration.

Frequently asked

What is david-gpu/srez?
It upscales 16x16 face thumbnails to 64x64 by rewiring a DCGAN to take low-res pixels instead of random noise as input.
Is srez open source?
Yes — david-gpu/srez is open source, released under the MIT license.
What language is srez written in?
david-gpu/srez is primarily written in Python.
How popular is srez?
david-gpu/srez has 5.3k stars on GitHub.
Where can I find srez?
david-gpu/srez is on GitHub at https://github.com/david-gpu/srez.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.