/ Модель

Характеристики

Лицензия
CC BY-SA 4.0
Опубликована
5 июл 2026

StyleGAN-FFHQ

Генерация изображенийТекст → изображение

Компактная реализация StyleGAN на PyTorch для безусловной генерации лиц размером 128×128 на ограниченных вычислительных ресурсах.

0скачиваний за 30 дней3лайкавеса обновлены5 июл 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Pradeep016 разработал эту модель с нуля как компактную генеративно-состязательную сеть, вдохновлённую StyleGAN и реализованную на чистом PyTorch. Модель обучена на уменьшенной версии FFHQ и предназначена для безусловной генерации изображений человеческих лиц размером 128×128 пикселей. Веса представлены как PyTorch state dictionary; для загрузки требуется локально определить архитектуру сети.

Модель служит демонстрацией генерации лиц на ограниченных вычислительных ресурсах, а не инструментом для высококачественной или промышленной генерации. Для более связных результатов рекомендуется использовать truncation factor ψ около 0,7. Из-за небольшой ёмкости и невысокого разрешения изображения могут выглядеть размытыми, а черты лица и фон — иметь геометрические артефакты. Обучение на FFHQ также наследует демографические искажения набора данных. Лицензия — CC BY-SA 4.0.

Сценарии применения

  • генерация синтетических портретов для экспериментов
  • демонстрация генеративной модели на одной GPU
  • изучение реализации GAN на чистом PyTorch

Ограничения

Изображения имеют низкое разрешение и могут быть размытыми; возможны артефакты в чертах лица и фоне. Для более связных результатов рекомендуется truncation factor ψ около 0,7; инференс медленнее и требовательнее к памяти, чем у оптимизированных реализаций StyleGAN.

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Model Card: StyleGAN Model (128x128 Faces)

Model Details

  • Model Type: Generative Adversarial Network (GAN)
  • Architecture: Custom StyleGAN-inspired variant (Pure PyTorch implementation)
  • Resolution: 128x128 (Inferred based on visual frequency outputs)
  • Parameters: 19M
  • Training Hardware: Kaggle (Single GPU - P100)
  • License: cc-by-sa-4.0

Model Description

This is a custom, from-scratch implementation of a StyleGAN-like architecture built entirely in native PyTorch. It strictly avoids NVIDIA's dnnlib and custom CUDA kernels (such as fused upsample/downsample and upfirdn2d filters).

The primary objective of this model is to serve as a compute-constrained proof-of-concept. It demonstrates that the global manifold of human faces can be successfully mapped using standard PyTorch operations on limited hardware (Kaggle free-tier GPUs), accepting the inherent trade-offs in memory overhead and operational latency.

Out-of-Scope Uses

  • High-Fidelity Generation: This model lacks the capacity to resolve high-frequency spatial details (skin texture, fine hair, sharp ocular reflections).
  • Production Environments: The reliance on unoptimized PyTorch operations makes inference slower and more memory-intensive compared to standard compiled StyleGAN models.

Limitations and Artifacts

Due to the architectural and computational constraints, users should expect specific structural anomalies:

  • Resolution Ceiling: The output is bottlenecked at a low resolution, resulting in a smoothed, blurry appearance.
  • Geometric Instability: At the edges of the learned distribution, the model struggles with background separation and asymmetrical feature alignment (e.g., glasses melting into skin, uneven eye placement).
  • Truncation Requirement: To generate structurally coherent faces, a truncation trick factor of approximately $\psi = 0.7$ is required. Sampling from the unconstrained prior will likely yield severe artifacts.

Training Data

  • Dataset: [FFHQ downsampled]
  • Note on Bias: Generative face models inherit the demographic biases present in their training data. Users should expect over-representation of specific ethnicities, ages, and lighting conditions based on the underlying dataset distribution.

How to Use (Code Snippet)

Because this repository contains a raw PyTorch .pt state dictionary rather than a Hugging Face compatible class, you must define the network architecture locally before loading the weights.

import torch
import torch.nn as nn
from huggingface_hub import hf_hub_download

# 1. Define the exact Generator architecture used during training
class CustomStyleGANGenerator(nn.Module):
    def __init__(self):
        super().__init__()
        # [USER MUST PASTE THE GENERATOR CLASS CODE HERE]
        pass

    def forward(self, z):
        # [USER MUST PASTE THE FORWARD PASS HERE]
        pass

# 2. Download and load the weights
repo_id = "Pradeep016/StyleGAN-FFHQ"
filename = "styleGAN_Model.pt"

weights_path = hf_hub_download(repo_id=repo_id, filename=filename)

# 3. Instantiate and load
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
generator = CustomStyleGANGenerator().to(device)
generator.load_state_dict(torch.load(weights_path, map_location=device))
generator.eval()

# 4. Generate a sample (example using latent dim of 512)
with torch.no_grad():
    z = torch.randn(1, 512).to(device)
    # Apply truncation psi=0.7 manually if required by your implementation
    output_image = generator(z)

truncated_64

Open In Colab

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм

Нельзя запустить

Безусловная генерация изображений пока не поддерживается.

Ревизия весов
5e0b5bb

0 моделей