File size: 1,673 Bytes
c6354b6
 
 
 
 
 
 
 
 
 
 
 
 
2fb19e5
c6354b6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---
license: mit
tags:
- gan
- pytorch
- vision
- dcgan
- faces
- humans
- face
metrics:
- loss
datasets:
- SDbiaseval/faces
---

# FaceGen v1 - 128px DCGAN

This model is a Deep Convolutional Generative Adversarial Network (DCGAN) trained to generate high-quality 128x128 images of human faces. It was trained for 250 epochs on a curated dataset of feline images, pushing the boundaries of traditional GAN architectures at this resolution.

## Sample
Here's a sample after epoch 200:
![image](https://cdn-uploads.huggingface.co/production/uploads/697f2832c2c5e4daa93cece7/xeVq-Mv_NSjbRNWOp6jMK.png)

## Model Details
- **Architecture:** DCGAN (Deep Convolutional GAN)
- **Resolution:** 128x128 pixels (RGB)
- **Parameters:** ~186M (Generator)
- **Training Duration:** ~22 hours on NVIDIA RTX 5060 Ti 16GB
- **Framework:** PyTorch with Mixed Precision (AMP)

## Training Hyperparameters
- **Batch Size:** 128
- **Learning Rate:** 0.0002
- **Optimizer:** Adam (Beta1: 0.5, Beta2: 0.999)
- **Latent Vector (Z):** 128 dimensions

## Training details
The full training code can be found as `train.py` in this repo.
The training data we used was from HF: stable-bias/faces

## Intended Use
This model is intended for artistic and research purposes. It demonstrates how GANs can capture complex faces and even eye reflections at medium resolutions.

## How to use
To use this model, clone this repository and run the provided inference script. Ensure you have `matplotlib`, `torch` and `torchvision` installed.

```bash
python3 inference.py
```

**Sample output:**
![image](https://cdn-uploads.huggingface.co/production/uploads/697f2832c2c5e4daa93cece7/zi_BYFDeK0x1aTEYpSLCj.png)