| language |
|
||
|---|---|---|---|
| license | apache-2.0 | ||
| tags |
|
||
| pipeline_tag | image-generation | ||
| library_name | snowgan |
The snowGAN is a generative adversarial network built to take in magnified pictures of snowpack and train a generator and discriminator to generate and discriminate pictures of the snow respectively. The end goal is to pre-train an AI that could potentially be rebuilt to assess other things like avalanche risk or wind loading.
This is an example of the data fed into the snowGAN...

This is an example of a picture generated from the snowGAN after training on ~1500 images over 50 epochs...

- Intended for research and artistic generation of snow scenes.
- Not suitable for safety-critical applications.
- Model outputs may not generalize well to very different domains.
- Dataset: Custom winter landscape dataset (~3,000 images)
- Source: Collected from open-source winter photography repositories
- Architecture: Wasserstein GAN with gradient penalty
- Optimizers: Adam with learning rate 1e-4
- Number of epochs: 100
- Framework: TensorFlow
- Generator Input: 100D latent vector
- Geneator Output: 1024x1024 RGB magnified snowpack image
- Discriminator Input: 1024x1024 RGB magnified snowpack image
- Discriminator Output: 1 classification of real or fake
- Model may produce unrealistic snow patterns — avoid misuse
snowgan --mode train --save_dir D:/Models/snowGAN/keras/ --gen_steps 4 --disc_lr 0.0001
snowgan --mode generate --n_samples 10Trained snowGAN backbones are published as tagged releases on HuggingFace Hub:
RMDig/snowGAN-magnified-profile— depth=1, profile modality.RMDig/snowGAN-core— depth=1, core modality.
Each release contains the weights-only artifacts (discriminator.weights.h5, generator.weights.h5, EMA / fade / lowres sidecars when applicable), their JSON config sidecars, and a MANIFEST.md describing training provenance (snowGAN git SHA, training data, advanced flags, persisted dataset splits, caveats).
from snowgan.weights import fetch
path = fetch("RMDig/snowGAN-core", "v0.1.0")
# path / "discriminator.weights.h5"
# path / "discriminator_config.json"
# path / "MANIFEST.md"Cached locally via the standard HuggingFace cache; subsequent calls with the same (repo, version) return instantly. Always pin to a tag for reproducibility — passing a branch name (e.g. "main") works but the artifacts can drift under you.
Requires the optional dependency: pip install snowgan[hub] (or pip install huggingface_hub).
After a training run finishes, bundle and push:
python scripts/release_weights.py \
--save-dir keras/snowgan/magnified_profiles \
--repo RMDig/snowGAN-magnified-profile \
--tag v0.1.0 \
--create-repo \ # first release only
--notes "First public release."Auto-generates MANIFEST.md from the run's configs, validates required artifacts are present, uploads via huggingface_hub.upload_folder as a single commit, and creates the tag. Use --dry-run to preview before pushing. Requires huggingface-cli login (or HF_TOKEN env var).
- CLAUDE.md — systems-engineering operating manual (session workflow, two-lens review, no-bandaids rule). Read this first if you're contributing.
- docs/architecture.md — system map: runtime flow, data pipeline, model shapes, loss math, checkpointing.
- docs/UPGRADES.md — tiered roadmap of known bugs and production- readiness gaps with a suggested sequencing.
- docs/TRANSFER_LEARNING_PLAN.md — design for transfer-learning this model's backbone into downstream metric prediction.
- docs/AVAI_BOOTSTRAP_PLAN.md — executable plan for the AvAI downstream project to consume this repo as a pretrained backbone.
SnowGAN works with stable TensorFlow and tf-nightly. For NVIDIA Blackwell GPUs, use a recent TensorFlow that supports CUDA 12.x and cuDNN 9, or tf-nightly. The CLI selects GPU by default and enables memory growth; use --device cpu to force CPU.
-
Linux (recommended):
- Install latest NVIDIA driver (R555+).
- Create/activate a virtual environment.
- Install tf-nightly and, if needed, CUDA runtime libs from PyPI:
pip install --upgrade pip pip install tf-nightly # If needed for GPU runtime on Linux: pip install nvidia-cuda-runtime-cu12 nvidia-cublas-cu12 nvidia-cudnn-cu12 - Verify GPU visibility:
python -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"
-
Windows: GPU wheels availability for nightly varies. If tf-nightly GPU is not available, use the latest stable
tensorflowwith GPU support, or run under WSL2 and follow Linux steps. -
Mixed precision: enable with
--mixed_precision Trueto usemixed_float16(recommended on recent NVIDIA GPUs).