GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - gustavecortal/gantrain: Train a FastGAN on your own photographs, on one GPU, up to 3072×2048.

BranchesTags
Open more actions menu

Latest commit

 

History

5 Commits
5 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
data
data
 
 
src/gantrain
src/gantrain
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
CITATION.cff
CITATION.cff
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
pyproject.toml
pyproject.toml
 
 

Repository files navigation

gantrain

gantrain trains a FastGAN on your own photographs, on one GPU, up to 3072×2048, and checks that it makes new images rather than copies. It trained the models that ganlive plays in its live demo.

Eight images generated by ganlive-amber, a 1536×1024 FastGAN trained with gantrain on my photographs of places, objects and textures

Quick start

1. Install

git clone https://github.com/gustavecortal/gantrain.git
cd gantrain
uv venv --python 3.12

Install PyTorch and torchvision for your hardware with uv pip install, then install gantrain:

uv pip install -e .

2. Curate your photographs

uv run --no-sync gantrain curate path/to/photos --out data/curated

This drops near-identical shots and holds out 15% for evaluation. A few hundred photographs are enough to start.

3. Train

uv run --no-sync gantrain train --data data/curated --out runs/mine --resolution 512 --width 768

Samples appear in runs/mine/samples as training goes. Resume a run with --resume runs/mine/checkpoints/<step>.pt.

4. Play it live

Convert a checkpoint with ganlive to play it in the browser, by hand or from drums.

How it works

FastGAN is a GAN designed for small image sets. Its discriminator also learns to reconstruct the real images it judges, and DiffAugment keeps it from memorising them. gantrain evaluate scores generated images against the held-out photographs and looks for copies. gantrain --help lists the other commands.

The published models were trained on one $350 Intel Arc A770. amber's settings are a good start for your own run:

uv run --no-sync gantrain train --data data/curated --out runs/amber --resolution 1024 --width 1536 --batch-size 16 --iterations 80000 --lr 3e-4 --lr-warmup 2000 --jacobian-weight 1.5 --compile

License

MIT.

About

Train a FastGAN on your own photographs, on one GPU, up to 3072×2048.

huggingface.co/collections/gustavecortal/ganlive-6ac56a61006a78b3e1ff5406

Topics

fastganfew-shot-learninggangenerative-adversarial-networkgenerative-arthigh-resolutionhuggingfaceimage-generationintel-arclatent-spacepytorchreal-timesmall-datatrainingxpu

Resources

Readme
MIT license
Activity

Stars

2 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.