Downloads · 30 days
0
kalingaru48/MSEmbGAN
MSEmbGAN is a machine learning model from kalingaru48. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
PyTorch implementation of "MSEmbGAN: Multi-Stitch Embroidery Synthesis via Region-Aware Texture Generation" (IEEE TVCG 2024, PubMed 39167500).
Downloads · 30 days
0
Access
Public
Updated Apr 24, 2026
Repo size
—
Likes
0
Public
Click a slice to open those files.
.py12 KB · 76%
From the Hugging Face model README
PyTorch implementation of "MSEmbGAN: Multi-Stitch Embroidery Synthesis via Region-Aware Texture Generation" (IEEE TVCG 2024, PubMed 39167500).
Takes a flat design image (e.g., a flower drawing) and synthesizes a photorealistic multi-stitch embroidery rendering with automatic stitch type assignment:
Input Content Image (RGB, 256x256)
↓
Stitch Classifier — Quick-shift segmentation + morphological erosion
↓
Region-Aware Texture Generation Network (WGAN, Lab L channel)
↓
Colorization Network (Lab ab channels)
↓
Final Colorized Embroidery Image
msembgan/modules.py — Custom layers (ReLUConv2d, INSResBlock, MisINSResBlock, etc.)msembgan/networks.py — All encoders, generators, discriminators from Supplemental Table 1msembgan/stitch_classifier.py — Quick-shift + erosion stitch classification + latent generatormsembgan/model.py — Full MSEmbGAN assembly (RTGN + CN)msembgan/losses.py — All losses: KL, L1, WGAN, color consistencymsembgan/dataset.py — Dataset loaders for aligned/unaligned datamsembgan/train.py — 2-step training pipelinemsembgan/inference.py — Inference scriptpip install torch torchvision numpy pillow scikit-image scipy tqdm
python -m msembgan.train \
--data_dir ./data \
--epochs 800 --batch_size 2 --lr 0.0002 \
--step1_epochs 200 --step2_epochs 500
python -m msembgan.inference \
--model ./checkpoints/final.pth \
--input ./image.jpg --output ./embroidery.png
Multi-Stitch Embroidery Dataset: https://drive.google.com/drive/folders/1VEg01D0vmO82oAYHr9D7KzDUCRza-DmU (Email [email protected] if unavailable)
MIT — clean-room implementation from the paper's architecture tables and equations.