# wll199566/learning-to-generate-chairs-with-convolutional-neural-networks architecture

> Architecture diagram of the GitHub repository wll199566/learning-to-generate-chairs-with-convolutional-neural-networks, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/wll199566/learning-to-generate-chairs-with-convolutional-neural-networks
- Repository: https://github.com/wll199566/learning-to-generate-chairs-with-convolutional-neural-networks

## Overview

This repository implements a PyTorch chair-image generator based on the cited 2014 paper. Its main workflow loads chair renders, masks, and class labels; encodes class and view conditions; trains a network to produce an image and segmentation mask; and validates and saves model checkpoints. A separate evaluation script loads a checkpoint and generates a result for requested conditions. The training excerpt is partial, so links for setup details not shown there are omitted; the dataset and evaluation behavior are supported by sampled source.

Main entry points: [`train.py`](https://github.com/wll199566/learning-to-generate-chairs-with-convolutional-neural-networks/blob/master/train.py) (Train and validate), [`evaluate.py`](https://github.com/wll199566/learning-to-generate-chairs-with-convolutional-neural-networks/blob/master/evaluate.py) (Generate prediction), [`modules/model.py`](https://github.com/wll199566/learning-to-generate-chairs-with-convolutional-neural-networks/blob/master/modules/model.py) (Conditional generator), [`Dataset.py`](https://github.com/wll199566/learning-to-generate-chairs-with-convolutional-neural-networks/blob/master/Dataset.py) (Load and encode)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Chair data"]
  node_dataset["Load and encode<br/>[Dataset.py]"]
end

subgraph group_training["Model training"]
  node_config["Training settings<br/>[config.yaml]"]
  node_trainer["Train and validate<br/>[train.py]"]
  node_model["Conditional generator<br/>[model.py]"]
  node_checkpoint["Model checkpoint"]
end

subgraph group_generation["Generation and evaluation"]
  node_evaluator["Generate prediction<br/>[evaluate.py]"]
  node_result["Image and mask"]
end

node_user(("Researcher"))
node_chairs[("Chair files")]

node_user -->|"starts training"| node_trainer
node_chairs -->|"loads renders and labels"| node_dataset
node_dataset -->|"supplies batches"| node_trainer
node_config -->|"sets defaults"| node_trainer
node_trainer -->|"trains and validates"| node_model
node_model -->|"returns predictions"| node_trainer
node_trainer -->|"saves weights"| node_checkpoint
node_user -->|"requests conditions"| node_evaluator
node_checkpoint -->|"loads weights"| node_evaluator
node_evaluator -->|"runs inference"| node_model
node_model -->|"returns predictions"| node_evaluator
node_evaluator -->|"produces image and mask"| node_result

click node_dataset "https://github.com/wll199566/learning-to-generate-chairs-with-convolutional-neural-networks/blob/master/Dataset.py"
click node_config "https://github.com/wll199566/learning-to-generate-chairs-with-convolutional-neural-networks/blob/master/config.yaml"
click node_trainer "https://github.com/wll199566/learning-to-generate-chairs-with-convolutional-neural-networks/blob/master/train.py"
click node_model "https://github.com/wll199566/learning-to-generate-chairs-with-convolutional-neural-networks/blob/master/modules/model.py"
click node_checkpoint "https://github.com/wll199566/learning-to-generate-chairs-with-convolutional-neural-networks/tree/master/checkpoints"
click node_evaluator "https://github.com/wll199566/learning-to-generate-chairs-with-convolutional-neural-networks/blob/master/evaluate.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_dataset toneBlue
class node_config,node_trainer,node_model,node_checkpoint,node_chairs toneAmber
class node_evaluator,node_result toneMint
class node_user toneIndigo
```

## Components

### Chair data

- [Load and encode](https://github.com/wll199566/learning-to-generate-chairs-with-convolutional-neural-networks/blob/master/Dataset.py): `Dataset.py`

### Model training

- [Training settings](https://github.com/wll199566/learning-to-generate-chairs-with-convolutional-neural-networks/blob/master/config.yaml): `config.yaml`
- [Train and validate](https://github.com/wll199566/learning-to-generate-chairs-with-convolutional-neural-networks/blob/master/train.py): `train.py`
- [Conditional generator](https://github.com/wll199566/learning-to-generate-chairs-with-convolutional-neural-networks/blob/master/modules/model.py): `modules/model.py`
- [Model checkpoint](https://github.com/wll199566/learning-to-generate-chairs-with-convolutional-neural-networks/tree/master/checkpoints): `checkpoints`

### Generation and evaluation

- [Generate prediction](https://github.com/wll199566/learning-to-generate-chairs-with-convolutional-neural-networks/blob/master/evaluate.py): `evaluate.py`
- **Image and mask**

### Other components

- **Researcher**
- **Chair files**

## Connections

- Researcher → Train and validate: starts training
- Chair files → Load and encode: loads renders and labels
- Load and encode → Train and validate: supplies batches
- Training settings → Train and validate: sets defaults
- Train and validate → Conditional generator: trains and validates
- Conditional generator → Train and validate: returns predictions
- Train and validate → Model checkpoint: saves weights
- Researcher → Generate prediction: requests conditions
- Model checkpoint → Generate prediction: loads weights
- Generate prediction → Conditional generator: runs inference
- Conditional generator → Generate prediction: returns predictions
- Generate prediction → Image and mask: produces image and mask
