How manumathewthomas/imagedenoisinggan works
Project Type and Purpose
• This is a full-stack ML web application centered on a Generative Adversarial Network (GAN) for image denoising.
• It has two main facets:
a. A training pipeline (train.py, test.py) that consumes a dataset, builds and optimizes the GAN, and writes model checkpoints.
b. An inference/demo web server (main.py + templates/static) that loads pretrained checkpoints and serves a browser-based UI for denoising images in real time.
File Structure Analysis
• Top-level scripts:
• train.py – training loop, loss functions, checkpoint saving
• test.py – evaluation on held-out data
• main.py – launches a web server (likely Flask) on port 8888 for inference
• model.py – defines generator / discriminator architectures
• conv_helper.py, utils.py, libs/utils.py, libs/vgg16.py – shared utilities, feature‐loss extraction
• Frontend:
• templates/index.html – Jinja2 template for the UI
• static/css, static/js, static/fonts – Bootstrap, custom styling, jQuery
• External resources:
• dataset/ – raw and noisy images for training
• Checkpoints/ – serialized TensorFlow model weights
• Configuration & dependencies: Python 3.5, TensorFlow v1.x, PIL
Relationships & Data Flows
• Training Path: Dataset → Training Script → TensorFlow Graph → Checkpoints
• Inference Path: Browser → HTTP → Web Server → Load Checkpoint → TensorFlow Inference → Return Denoised Image → Browser
• Utility modules (conv_helper.py, libs/) are shared by both training and inference
Architectural Patterns & Principles
• MVC-style separation:
• Model layer = model.py + TensorFlow code
• View layer = templates/index.html + static assets
• Controller layer = main.py routing + input handling
• Modular design: helper libraries in libs/ for reusability
• Pipeline separation: distinct training vs. inference workflows