Downloads · 30 days
0
gperdrizet/GANNs-with-friends
GANNs-with-friends is a image-to-image model from gperdrizet. Use it when you need one image transformed into another. The card lists the license as mit.
An educational distributed deep learning system where students participate as workers in a compute cluster to train a GAN (Generative Adversarial Network) to generate celebrity faces.
Downloads · 30 days
0
Access
Public
Updated Feb 19, 2026
Repo size
1.5 GB
Likes
0
Public
Click a slice to open those files.
.zip1.4 GB · 98%
From the Hugging Face model README
An educational distributed deep learning system where students participate as workers in a compute cluster to train a GAN (Generative Adversarial Network) to generate celebrity faces.
This repository contains a DCGAN (Deep Convolutional GAN) trained on the CelebA dataset to generate 64x64 RGB images of human faces. The model follows the architecture described in the original DCGAN paper.
Generator:
Discriminator:
| Parameter | Value |
|---|---|
| Image Size | 64x64 |
| Latent Dimension | 100 |
| Batch Size | 32-128 |
| Learning Rate | 0.0002 |
| Optimizer | Adam (β1=0.5, β2=0.999) |
| Loss | BCEWithLogitsLoss |
This repository includes the CelebA (CelebFaces Attributes) dataset for training.
The dataset is stored in this repository at:
data/img_align_celeba.zip
@inproceedings{liu2015faceattributes,
title = {Deep Learning Face Attributes in the Wild},
author = {Liu, Ziwei and Luo, Ping and Wang, Xiaogang and Tang, Xiaoou},
booktitle = {Proceedings of the IEEE International Conference on Computer Vision (ICCV)},
year = {2015}
}
import torch
from huggingface_hub import hf_hub_download
# Download checkpoint
checkpoint_path = hf_hub_download(
repo_id="gperdrizet/GANNs-with-friends",
filename="checkpoint_latest.pth"
)
# Load checkpoint
checkpoint = torch.load(checkpoint_path, map_location='cpu')
# Define Generator architecture
import torch.nn as nn
class Generator(nn.Module):
def __init__(self, latent_dim=100, num_channels=3, feature_maps=64):
super(Generator, self).__init__()
self.main = nn.Sequential(
nn.ConvTranspose2d(latent_dim, feature_maps * 8, 4, 1, 0, bias=False),
nn.BatchNorm2d(feature_maps * 8),
nn.ReLU(True),
nn.ConvTranspose2d(feature_maps * 8, feature_maps * 4, 4, 2, 1, bias=False),
nn.BatchNorm2d(feature_maps * 4),
nn.ReLU(True),
nn.ConvTranspose2d(feature_maps * 4, feature_maps * 2, 4, 2, 1, bias=False),
nn.BatchNorm2d(feature_maps * 2),
nn.ReLU(True),
nn.ConvTranspose2d(feature_maps * 2, feature_maps, 4, 2, 1, bias=False),
nn.BatchNorm2d(feature_maps),
nn.ReLU(True),
nn.ConvTranspose2d(feature_maps, num_channels, 4, 2, 1, bias=False),
nn.Tanh()
)
def forward(self, z):
return self.main(z)
# Load weights
generator = Generator()
generator.load_state_dict(checkpoint['generator_state_dict'])
generator.eval()
# Generate images
with torch.no_grad():
noise = torch.randn(16, 100, 1, 1)
fake_images = generator(noise)
# Images are in range [-1, 1], normalize to [0, 1] for display
fake_images = (fake_images + 1) / 2
from huggingface_hub import hf_hub_download
import zipfile
# Download dataset
zip_path = hf_hub_download(
repo_id="gperdrizet/GANNs-with-friends",
filename="data/img_align_celeba.zip"
)
# Extract
with zipfile.ZipFile(zip_path, 'r') as zip_ref:
zip_ref.extractall('data/')
This model is part of GANNs with Friends, an educational distributed deep learning project.
Students learn:
This model and dataset are intended for:
If you use this project in your work, please cite:
@software{ganns_with_friends,
title = {GANNs with Friends: Educational Distributed GAN Training},
author = {Perdrizet, George},
url = {https://github.com/gperdrizet/GANNs-with-friends},
year = {2025}
}
This project is licensed under the MIT License. See the LICENSE file for details.