Generative models
GanScape
A GAN that turns a segmentation mask into a height map, which I then render as 3D terrain.
Python
PyTorch
NumPy
SciPy
Techniques: Attention U-Net, PatchGAN, Spectral norm, AMP, PyVista
View the code

The problem
Sculpting terrain by hand is slow. GanScape learns the mapping from a simple segmentation mask to a height map with believable detail, so a rough layout becomes a landscape you can render in 3D.
How I built it
- 01An attention-gated U-Net generator translates segmentation masks into height maps, with a PatchGAN discriminator judging local realism.
- 02Spectral normalization and instance normalization keep adversarial training stable; mixed-precision (AMP) training speeds up convergence.
- 03OpenSimplex adds fractal detail, SciPy filters the output, and PyVista renders it as a 3D surface.