Waxfashion StyleGAN π¨
This is a StyleGAN2 model trained to generate African Wax Pattern fashion designs.
Model Details
- Model Type: StyleGAN2
- Dataset:
paceailab/AfricanWaxPatterns_2KDataset
- Input: Random seed (latent vector)
- Output: 512x512 wax pattern images
Usage π
You can use this model in your projects with:
!git clone https://github.com/researchpace/waxfashion.git
from huggingface_hub import hf_hub_download
import torch
import legacy
import dnnlib
import sys
sys.path.append('/content/waxfashion/stylegan2-ada-pytorch')
# Load model
model_path = hf_hub_download("paceailab/Waxfashion_StyleGAN", "selected_models/styleGAN2ada_Africanwax.pkl")
# Load the pre-trained StyleGAN2 model
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
with dnnlib.util.open_url(model_path) as f:
G = legacy.load_network_pkl(f)['G_ema'].to(device) # Load the generator
# Generate and display image
import numpy as np
import PIL.Image
def generate_image(seed=42):
z = torch.from_numpy(np.random.RandomState(seed).randn(1, G.z_dim)).to(device)
img = G(z, None) # Generate image
img = (img.permute(0, 2, 3, 1) * 127.5 + 128).clamp(0, 255).to(torch.uint8)[0].cpu().numpy()
return PIL.Image.fromarray(img)
image = generate_image(seed=100)
image.show()
Inference Providers
NEW
This model is not currently available via any of the supported Inference Providers.
The model cannot be deployed to the HF Inference API:
The model has no pipeline_tag.