Downloads · 30 days
0
balgot/text-2-stylegan3
text-2-stylegan3 is a machine learning model from balgot. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for pytorch. The card lists the license as openrail.
This model was created as a part of the project for FI:PA228 (Masaryk University), inspired by this paper: Face Generation from Textual Features using Conditionally trained Inputs to Generative Adversarial Networks
Downloads · 30 days
0
Access
Public
Updated May 16, 2023
Repo size
42.4 MB
Likes
1
Public
Click a slice to open those files.
.gif2 MB · 49%
From the Hugging Face model README
This model was created as a part of the project for FI:PA228 (Masaryk University), inspired by this paper: Face Generation from Textual Features using Conditionally trained Inputs to Generative Adversarial Networks
It was trained on the generated dataset from BLIP and StyleGAN3. See the corresponding notebook for further details.
import torch.nn as nn
# for now, the model class needs to be defined, so...
class LaTran(nn.Module):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.pipe = nn.Sequential(
nn.Linear(384, 512),
nn.ReLU(),
nn.Linear(512, 512)
)
def forward(self, v):
return self.pipe(v.unsqueeze(1))
# Instantiate and load the model
dev = ... # device to use
PATH = "translation_model-sd.pt" # local path
model = LaTran().to(dev)
model.load_state_dict(torch.load(TRANSLATION_MODEL, map_location=dev))
For the demo of the whole pipeline, or how this model helps to generate a final image, visits text-to-stylegan HF space.
Prompt: attractive young woman, blond hair

Prompt initial: cute young boy, blond hair, blue eyes, smiling
Prompt second: old man, short gray hair, glasses, wearing hat
<img src="https://huggingface.co/balgot/bert-2-stylegan3/resolve/main/young2old.gif" width="200" height="200" />